From d0cbdc1647f793ea9b2922970022794e92202d4a Mon Sep 17 00:00:00 2001 From: streetturtle Date: Sun, 14 Apr 2019 20:07:15 -0400 Subject: Add table with config to the readme --- volumebar-widget/volumebar.lua | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'volumebar-widget/volumebar.lua') diff --git a/volumebar-widget/volumebar.lua b/volumebar-widget/volumebar.lua index c1fcf71..18e0f40 100644 --- a/volumebar-widget/volumebar.lua +++ b/volumebar-widget/volumebar.lua @@ -26,12 +26,17 @@ local function worker(args) local args = args or {} - local main_color = args.main_color or beautiful.widget_main_color - local mute_color = args.mute_color or beautiful.widget_red + local main_color = args.main_color or beautiful.fg_normal + local mute_color = args.mute_color or beautiful.fg_urgent local width = args.width or 50 local shape = args.shape or 'bar' local margins = args.margins or 10 + local get_volume_cmd = args.get_volume_cmd or GET_VOLUME_CMD + local inc_volume_cmd = args.inc_volume_cmd or INC_VOLUME_CMD + local dec_volume_cmd = args.dec_volume_cmd or DEC_VOLUME_CMD + local tog_volume_cmd = args.tog_volume_cmd or TOG_VOLUME_CMD + local volumebar_widget = wibox.widget { max_value = 1, forced_width = width, @@ -59,19 +64,19 @@ local function worker(args) volumebar_widget:connect_signal("button::press", function(_, _, _, button) if (button == 4) then - awful.spawn(INC_VOLUME_CMD) + awful.spawn(inc_volume_cmd) elseif (button == 5) then - awful.spawn(DEC_VOLUME_CMD) + awful.spawn(dec_volume_cmd) elseif (button == 1) then - awful.spawn(TOG_VOLUME_CMD) + awful.spawn(tog_volume_cmd) end - spawn.easy_async(GET_VOLUME_CMD, function(stdout, stderr, exitreason, exitcode) + spawn.easy_async(get_volume_cmd, function(stdout, stderr, exitreason, exitcode) update_graphic(volumebar_widget, stdout, stderr, exitreason, exitcode) end) end) - watch(GET_VOLUME_CMD, 1, update_graphic, volumebar_widget) + watch(get_volume_cmd, 1, update_graphic, volumebar_widget) return volumebar_widget end -- cgit v1.2.3