From 46541730ebd93eb90e006da832c3ba4bdecfe699 Mon Sep 17 00:00:00 2001 From: Pavel Makhov Date: Thu, 4 Oct 2018 10:26:27 -0400 Subject: refactor volumebar/arc widgets --- volumearc-widget/volumearc.lua | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'volumearc-widget') diff --git a/volumearc-widget/volumearc.lua b/volumearc-widget/volumearc.lua index c2c0af9..9cd7865 100644 --- a/volumearc-widget/volumearc.lua +++ b/volumearc-widget/volumearc.lua @@ -5,7 +5,7 @@ -- https://github.com/streetturtle/awesome-wm-widgets/tree/master/volumearc-widget -- @author Pavel Makhov --- @copyright 2017 Pavel Makhov +-- @copyright 2018 Pavel Makhov ------------------------------------------------- local awful = require("awful") @@ -38,11 +38,9 @@ local update_graphic = function(widget, stdout, _, _, _) volume = tonumber(string.format("% 3d", volume)) widget.value = volume / 100; - if mute == "off" then - widget.colors = { beautiful.widget_red } - else - widget.colors = { beautiful.widget_main_color } - end + widget.colors = mute == 'off' and { beautiful.widget_red } + or { beautiful.widget_main_color } + end volumearc:connect_signal("button::press", function(_, _, _, button) -- cgit v1.2.3