diff options
-rw-r--r-- | volume-widget/volume.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/volume-widget/volume.lua b/volume-widget/volume.lua index c403dfd..bdbf134 100644 --- a/volume-widget/volume.lua +++ b/volume-widget/volume.lua @@ -21,14 +21,16 @@ volume_widget = wibox.widget { watch( 'amixer -D pulse sget Master', 1, function(widget, stdout, stderr, reason, exit_code) + local mute = string.match(stdout, "%[(o%D%D?)%]") local volume = string.match(stdout, "(%d?%d?%d)%%") volume = tonumber(string.format("% 3d", volume)) local volume_icon_name - if (volume >= 0 and volume < 25) then volume_icon_name="audio-volume-muted-symbolic" + if mute == "off" then volume_icon_name="audio-volume-muted-symbolic" + elseif (volume >= 0 and volume < 25) then volume_icon_name="audio-volume-muted-symbolic" elseif (volume >= 25 and volume < 50) then volume_icon_name="audio-volume-low-symbolic" elseif (volume >= 50 and volume < 75) then volume_icon_name="audio-volume-medium-symbolic" elseif (volume >= 75 and volume <= 100) then volume_icon_name="audio-volume-high-symbolic" end volume_widget.image = path_to_icons .. volume_icon_name .. ".svg" end -)
\ No newline at end of file +) |