diff options
author | Pavel Makhov <pavel.makhov@savoirfairelinux.com> | 2017-06-05 21:22:43 -0400 |
---|---|---|
committer | Pavel Makhov <pavel.makhov@savoirfairelinux.com> | 2017-06-05 21:22:43 -0400 |
commit | 5cce26ca95578dc989be23e5826befd655d574e7 (patch) | |
tree | a12fe7b4ef635ea961b708bdd8dcf636cec67966 | |
parent | d86344b1ff053581ab0f257980abf313d5ba9c43 (diff) |
Few small improvements for volume widget
-rw-r--r-- | volume-widget/volume.lua | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/volume-widget/volume.lua b/volume-widget/volume.lua index 481d244..a03149c 100644 --- a/volume-widget/volume.lua +++ b/volume-widget/volume.lua @@ -9,17 +9,17 @@ local request_command = 'amixer -D pulse sget Master' volume_widget = wibox.widget { { id = "icon", - image = path_to_icons .. "audio-volume-muted-symbolic.svg", - resize = false, + image = path_to_icons .. "audio-volume-muted-symbolic.svg", + resize = false, widget = wibox.widget.imagebox, }, - layout = wibox.container.margin(brightness_icon, 0, 0, 3), + layout = wibox.container.margin(_, _, _, 3), set_image = function(self, path) self.icon.image = path end } -local update_graphic = function(widget, stdout, stderr, reason, exit_code) +local update_graphic = function(widget, stdout, _, _, _) local mute = string.match(stdout, "%[(o%D%D?)%]") local volume = string.match(stdout, "(%d?%d?%d)%%") volume = tonumber(string.format("% 3d", volume)) @@ -42,10 +42,10 @@ volume_widget:connect_signal("button::press", function(_,_,_,button) elseif (button == 5) then awful.spawn("amixer -D pulse sset Master 5%-", false) elseif (button == 1) then awful.spawn("amixer -D pulse sset Master toggle", false) end - + spawn.easy_async(request_command, function(stdout, stderr, exitreason, exitcode) update_graphic(volume_widget, stdout, stderr, exitreason, exitcode) end) end) -watch(request_command, 1, update_graphic, volume_widget) +watch(request_command, 1, update_graphic, volume_widget)
\ No newline at end of file |