summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2021-06-04 11:10:21 +0200
committerAnton Khirnov <anton@khirnov.net>2021-06-04 11:10:21 +0200
commit5fd8b72eb1d8b1b1ef981d9ba57e8070d51c308e (patch)
treeafa726b0c4e552d836ba2b8e674e26323c53df2e
parentb9c7fb023b9a5810bc9788966fc664458057e9f2 (diff)
bindings: add a binding for mute
-rw-r--r--bindings.lua1
-rw-r--r--utils.lua4
2 files changed, 5 insertions, 0 deletions
diff --git a/bindings.lua b/bindings.lua
index 08ac445..087e4c3 100644
--- a/bindings.lua
+++ b/bindings.lua
@@ -34,6 +34,7 @@ function M.create(workspace)
-- audio control
awful.key({ modkey }, "Prior", function () utils.vol_control(1) end),
awful.key({ modkey }, "Next", function () utils.vol_control(-1) end),
+ awful.key({ modkey }, "End", utils.vol_mute_toggle),
awful.key({ modkey }, "grave", function () awful.spawn("mpc toggle") end),
awful.key({ modkey }, "b", function () awful.spawn("mpc next") end),
awful.key({ modkey }, "p", function () awful.spawn("mpc prev") end),
diff --git a/utils.lua b/utils.lua
index 77f2b54..01bd70f 100644
--- a/utils.lua
+++ b/utils.lua
@@ -35,6 +35,10 @@ function M.vol_control(n)
awful.spawn(cmd)
end
+function M.vol_mute_toggle()
+ awful.spawn("amixer -q set Master toggle")
+end
+
function M.spawn_current(command)
awful.spawn(command, {tag = mouse.screen.selected_tag})
end