Few small improvements for volume widget

This commit is contained in:
Pavel Makhov 2017-06-05 21:22:43 -04:00
parent d86344b1ff
commit 5cce26ca95
1 changed files with 6 additions and 6 deletions

View File

@ -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))