Forgot to add playerctl-fast script

(cherry picked from commit 07f8badd80)
This commit is contained in:
Warren Hood 2023-02-28 23:25:17 +02:00 committed by Warren Hood
parent dca845feac
commit 60717e3164

37
scripts/.scripts/playerctl-fast Executable file
View file

@ -0,0 +1,37 @@
#!/usr/bin/env bash
set -euo pipefail
case "${1:-}" in
next)
MEMBER=Next
;;
previous)
MEMBER=Previous
;;
play)
MEMBER=Play
;;
pause)
MEMBER=Pause
;;
play-pause)
MEMBER=PlayPause
;;
*)
echo "Usage: $0 next|previous|play|pause|play-pause"
exit 1
;;
esac
exec dbus-send \
--print-reply \
--dest="org.mpris.MediaPlayer2.$(playerctl -l | head -n 1)" \
/org/mpris/MediaPlayer2 \
"org.mpris.MediaPlayer2.Player.$MEMBER"