Verified Commit be1b8127 authored by Ave's avatar Ave 🤔

Make volume dial show x when it's muted

parent b9af115b
......@@ -22,7 +22,7 @@ local TOG_VOLUME_CMD = 'amixer sset Master toggle'
local text = wibox.widget {
id = "txt",
align = "center",
font = "Play 5",
font = "Pragmata Pro 5",
widget = wibox.widget.textbox
}
......@@ -41,14 +41,14 @@ local volumearc = wibox.widget {
local volumearc_widget = volumearc --wibox.container.mirror(volumearc, { horizontal = true })
local update_graphic = function(widget, stdout, _, _, _)
local mute = string.match(stdout, "%[(o%D%D?)%]")
local mute = string.match(stdout, "%[(off)%]")
local volume = string.match(stdout, "(%d?%d?%d)%%")
volume = tonumber(string.format("% 3d", volume))
text.text = volume
widget.value = volume / 100;
if mute == "off" then
widget.colors = { beautiful.widget_red }
text.text = "x "
else
widget.colors = { beautiful.widget_main_color }
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment