diff options
author | Pavel Makhov <pmakhov@touchtunes.com> | 2019-02-26 11:16:37 -0500 |
---|---|---|
committer | Pavel Makhov <pmakhov@touchtunes.com> | 2019-02-26 11:16:37 -0500 |
commit | ce02f3bf7ed808de766b34e17f19f2ad4ef15c99 (patch) | |
tree | 88331f6fe76a1cdc6ed89e481e659026397a492c | |
parent | 29a9761c4d0f851b75863c59854a17ea5a6d8e43 (diff) |
Simplify widget's code by changing the direction of arc
-rw-r--r-- | volumearc-widget/volumearc.lua | 18 |
1 files changed, 13 insertions, 5 deletions
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 |