Switch media controls to QS MPRIS
This commit is contained in:
@@ -1,23 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Control media playback and show the Omarchy OSD
|
||||
# omarchy:args=<next|previous|play-pause|play|pause>
|
||||
# omarchy:examples=omarchy audio player next | omarchy audio player play-pause
|
||||
|
||||
action="${1:-play-pause}"
|
||||
|
||||
case "$action" in
|
||||
next) fallback_message="Next track" ;;
|
||||
previous) fallback_message="Previous track" ;;
|
||||
play) fallback_message="Playing" ;;
|
||||
pause) fallback_message="Paused" ;;
|
||||
*) fallback_message="Play/pause" ;;
|
||||
esac
|
||||
|
||||
playerctl "$action" >/dev/null 2>&1 || true
|
||||
sleep 0.05
|
||||
|
||||
message=$(playerctl metadata --format '{{title}}' 2>/dev/null || true)
|
||||
[[ -n $message ]] || message=$(playerctl metadata --format '{{playerName}}' 2>/dev/null || true)
|
||||
|
||||
omarchy-osd -i media -m "${message:-$fallback_message}"
|
||||
Reference in New Issue
Block a user