summaryrefslogtreecommitdiff
path: root/volumebar-widget/volumebar.lua
diff options
context:
space:
mode:
authorstreetturtle <streetturtle@gmail.com>2019-04-14 20:07:15 -0400
committerstreetturtle <streetturtle@gmail.com>2019-04-14 20:07:15 -0400
commitd0cbdc1647f793ea9b2922970022794e92202d4a (patch)
treea0eed2e048659e4fcd6ee5e74852d6d3cf3e0a0d /volumebar-widget/volumebar.lua
parent8e92a8541bba98132ce92307400f458bda65295b (diff)
Add table with config to the readme
Diffstat (limited to 'volumebar-widget/volumebar.lua')
-rw-r--r--volumebar-widget/volumebar.lua19
1 files changed, 12 insertions, 7 deletions
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