mirror of
https://github.com/WarrenHood/dotfiles.git
synced 2025-04-29 20:04:59 +01:00
Forgot to add playerctl-fast script
(cherry picked from commit 07f8badd80
)
This commit is contained in:
parent
dca845feac
commit
60717e3164
37
scripts/.scripts/playerctl-fast
Executable file
37
scripts/.scripts/playerctl-fast
Executable 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"
|
Loading…
Reference in a new issue