From ce02f3bf7ed808de766b34e17f19f2ad4ef15c99 Mon Sep 17 00:00:00 2001 From: Pavel Makhov Date: Tue, 26 Feb 2019 11:16:37 -0500 Subject: Simplify widget's code by changing the direction of arc --- volumearc-widget/volumearc.lua | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'volumearc-widget/volumearc.lua') diff --git a/volumearc-widget/volumearc.lua b/volumearc-widget/volumearc.lua index 9cd7865..63500bc 100644 --- a/volumearc-widget/volumearc.lua +++ b/volumearc-widget/volumearc.lua @@ -19,19 +19,27 @@ local INC_VOLUME_CMD = 'amixer -D pulse sset Master 5%+' local DEC_VOLUME_CMD = 'amixer -D pulse sset Master 5%-' local TOG_VOLUME_CMD = 'amixer -D pulse sset Master toggle' +local PATH_TO_ICON = "/usr/share/icons/Arc/status/symbolic/audio-volume-muted-symbolic.svg" + +local icon = { + id = "icon", + image = PATH_TO_ICON, + resize = true, + widget = wibox.widget.imagebox, +} + local volumearc = wibox.widget { + icon, max_value = 1, thickness = 2, start_angle = 4.71238898, -- 2pi*3/4 - forced_height = 17, - forced_width = 17, + forced_height = 18, + forced_width = 18, bg = "#ffffff11", paddings = 2, widget = wibox.container.arcchart } -local volumearc_widget = wibox.container.mirror(volumearc, { horizontal = true }) - local update_graphic = function(widget, stdout, _, _, _) local mute = string.match(stdout, "%[(o%D%D?)%]") local volume = string.match(stdout, "(%d?%d?%d)%%") @@ -56,4 +64,4 @@ end) watch(GET_VOLUME_CMD, 1, update_graphic, volumearc) -return volumearc_widget \ No newline at end of file +return volumearc \ No newline at end of file -- cgit v1.2.3