Fix MPD/Spotify hybrid control

This commit is contained in:
crater2150 2019-08-26 17:21:09 +02:00
parent 2699230f05
commit eb03addf11

View file

@ -78,11 +78,11 @@ local myglobalkeys = awful.util.table.join(
--{{{ Modal mappings
awful.key({ modkey }, "m", function()
awful.spawn.easy_async("playerctl -p spotify status", function(stdout, stderr, reason, exitcode)
awful.spawn.easy_async("which playerctl && playerctl -p spotify status", function(stdout, stderr, reason, exitcode)
if exitcode > 0 then
mb.grab(mpdmap, "MPD", true)
mb.grab{keymap=mpdmap, name="MPD", stay_in_mode=true}
else
mb.grab(mprismap, "Spotify", true)
mb.grab{keymap=mprismap, name="Spotify", stay_in_mode=true}
end
end)
end),