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.
This commit is contained in:
Vincent Bernat 2013-11-01 15:40:58 +01:00
parent 8f6b6733bc
commit 049e7abdfd

View file

@ -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)
)