update waybar scripts

This commit is contained in:
2025-03-18 20:07:55 -07:00
parent b931f47e07
commit 8e19d89ba2
5 changed files with 38 additions and 7 deletions

25
waybar/playerctl.sh Executable file
View File

@@ -0,0 +1,25 @@
#!/bin/sh
PLAYER="$1"
if [ -z "$PLAYER" ]; then
echo "Usage: $0 <player>"
exit 1
fi
STATUS="$(playerctl -p "$PLAYER" status)"
if [ -z "$STATUS" ] || [ "$STATUS" = "Stopped" ]; then
exit 0
elif [ "$STATUS" = "Paused" ]; then
STATUS=" "
elif [ "$STATUS" = "Playing" ]; then
STATUS=" "
else
exit 0
fi
TITLE="$(playerctl -p "$PLAYER" metadata title)"
ARTIST="$(playerctl -p "$PLAYER" metadata artist)"
printf "%s\n" "$STATUS$TITLE - $ARTIST"