From 60717e31644427516c8c55ece6fa61c33bff9694 Mon Sep 17 00:00:00 2001 From: Warren Hood Date: Tue, 28 Feb 2023 23:25:17 +0200 Subject: [PATCH] Forgot to add playerctl-fast script (cherry picked from commit 07f8badd80e157705e1e0ebfdb8a144f4be05380) --- scripts/.scripts/playerctl-fast | 37 +++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 scripts/.scripts/playerctl-fast diff --git a/scripts/.scripts/playerctl-fast b/scripts/.scripts/playerctl-fast new file mode 100755 index 0000000..c90437a --- /dev/null +++ b/scripts/.scripts/playerctl-fast @@ -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"