Cleaned up now_playing script output and included a check for if cmus is playing

This commit is contained in:
Thai Noodles 2024-01-10 18:51:22 -08:00
parent e5b9b32e4d
commit 368b81ae39

View File

@ -1,4 +1,8 @@
#!/usr/bin/env sh
NOWPLAYING=$(basename "$(cmus-remote -Q | grep file | cut -f 2- -d ' ')")
echo "{\"text\":\"\"$NOWPLAYING\"}"
CHECK=$(cmus-remote -Q | grep status | cut -f 2- -d ' ')
if [ "$CHECK" = "playing" ]; then
NOWPLAYING=$(basename "$(cmus-remote -Q | grep file | cut -f 2- -d ' ')")
printf " | "
printf '%s' "$NOWPLAYING"
fi