summaryrefslogtreecommitdiff
path: root/volume-widget/volume.lua
diff options
context:
space:
mode:
authorstreetturtle <streetturtle@users.noreply.github.com>2021-08-27 20:51:24 -0400
committerGitHub <noreply@github.com>2021-08-27 20:51:24 -0400
commitdbb474eaf7363b735e3fa53e43ce3bbbf7a69df7 (patch)
tree9fff4ba1845c2baa610b88f6255dfacee4b070d2 /volume-widget/volume.lua
parent5f60fc659b230ef7506961b3686119e5e047965b (diff)
parent14bb270274da48bd2bd5e2fddbeccf80a7c13d42 (diff)
Merge pull request #291 from TD-Sky/master
Add the 'step' arg for volume-widget
Diffstat (limited to 'volume-widget/volume.lua')
-rw-r--r--volume-widget/volume.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/volume-widget/volume.lua b/volume-widget/volume.lua
index c711950..a22effd 100644
--- a/volume-widget/volume.lua
+++ b/volume-widget/volume.lua
@@ -18,8 +18,8 @@ local utils = require("awesome-wm-widgets.volume-widget.utils")
local LIST_DEVICES_CMD = [[sh -c "pacmd list-sinks; pacmd list-sources"]]
local GET_VOLUME_CMD = 'amixer -D pulse sget Master'
-local INC_VOLUME_CMD = 'amixer -D pulse sset Master 5%+'
-local DEC_VOLUME_CMD = 'amixer -D pulse sset Master 5%-'
+local INC_VOLUME_CMD
+local DEC_VOLUME_CMD
local TOG_VOLUME_CMD = 'amixer -D pulse sset Master toggle'
@@ -166,6 +166,10 @@ local function worker(user_args)
local mixer_cmd = args.mixer_cmd or 'pavucontrol'
local widget_type = args.widget_type
local refresh_rate = args.refresh_rate or 1
+ local step = args.step or 5
+
+ INC_VOLUME_CMD = 'amixer -D pulse sset Master ' .. step .. '%+'
+ DEC_VOLUME_CMD = 'amixer -D pulse sset Master ' .. step .. '%-'
if widget_types[widget_type] == nil then
volume.widget = widget_types['icon_and_text'].get_widget(args.icon_and_text_args)