From 049e7abdfd419810136af62857ea4fd2262fbc3b Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Fri, 1 Nov 2013 15:40:58 +0100 Subject: [PATCH] music: also allows one to use modal keys to control music player By using mod+s, we switch to a local keymap that control the music player. The keys are then the same as in XMMS. --- rc/bindings.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/rc/bindings.lua b/rc/bindings.lua index aa8d418..65b0d9b 100644 --- a/rc/bindings.lua +++ b/rc/bindings.lua @@ -220,6 +220,22 @@ config.keys.global = awful.util.table.join( awful.key({ }, "XF86AudioNext", music.next), awful.key({ }, "XF86AudioPrev", music.previous), + awful.key({ modkey }, "s", function() + keygrabber.run(function(mod, key, event) + if event == "release" then + return true + end + keygrabber.stop() + if key == "z" then music.previous() + elseif key == "x" then music.play() + elseif key == "c" then music.pause() + elseif key == "v" then music.stop() + elseif key == "b" then music.next() + end + return true + end) + end), + -- Help awful.key({ modkey, }, "F1", keydoc.display) )