From 5f14eb92865f608185b636c7e188c1f2a0722766 Mon Sep 17 00:00:00 2001 From: josiah Date: Thu, 23 Apr 2020 15:44:43 -0500 Subject: [PATCH] Add media keys control to awesome. -- requires the alas-utils and playerctl packages. --- .config/awesome/rc.lua | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.config/awesome/rc.lua b/.config/awesome/rc.lua index f2d6970..2350279 100644 --- a/.config/awesome/rc.lua +++ b/.config/awesome/rc.lua @@ -417,7 +417,26 @@ for i = 1, 9 do end end end, - {description = "toggle focused client on tag #" .. i, group = "tag"}) + {description = "toggle focused client on tag #" .. i, group = "tag"}), + awful.key({}, "XF86AudioLowerVolume", function () + awful.util.spawn("amixer -q -D pulse sset Master 5%-", false) + end), + awful.key({}, "XF86AudioRaiseVolume", function () + awful.util.spawn("amixer -q -D pulse sset Master 5%+", false) + end), + awful.key({}, "XF86AudioMute", function () + awful.util.spawn("amixer -D pulse set Master 1+ toggle", false) + end), + -- Media Keys + awful.key({}, "XF86AudioPlay", function() + awful.util.spawn("playerctl play-pause", false) + end), + awful.key({}, "XF86AudioNext", function() + awful.util.spawn("playerctl next", false) + end), + awful.key({}, "XF86AudioPrev", function() + awful.util.spawn("playerctl previous", false) + end) ) end