now-playing: tweaks

This commit is contained in:
Inhji 2023-10-20 23:57:52 +02:00
parent 0e8a5c2c12
commit ca3ef3185e
2 changed files with 25 additions and 7 deletions

View File

@ -1,8 +1,22 @@
#!/usr/bin/env bash
TITLE=$(cmus-remote -Q | grep title | cut --delimiter=' ' --fields=3-)
ARTIST=$(cmus-remote -Q | grep ' artist ' | cut --delimiter=' ' --fields=3-)
#STATUS=$(cmus-remote -Q | grep status | cut --delimiter=' ' --fields=2)
STATUS=$(playerctl status)
#TITLE=$(cmus-remote -Q | grep title | cut --delimiter=' ' --fields=3-)
TITLE=$(playerctl metadata title)
#ARTIST=$(cmus-remote -Q | grep ' artist ' | cut --delimiter=' ' --fields=3-)
ARTIST=$(playerctl metadata artist)
if [ $STATUS = "Playing" ] ; then
ICON=" "
elif [ $STATUS = "Paused" ] ; then
ICON=" "
else
ICON=""
fi
if [ -n "$ARTIST" ] || [ -n "$TITLE" ] ; then
echo "$ARTIST - $TITLE"
echo "$ICON $ARTIST - $TITLE"
fi

View File

@ -45,13 +45,17 @@
"format": " {capacity}%",
"format-charging": " {capacity}%",
"format-plugged": " {capacity}%",
"format-full": " }capacity}%"
"format-full": " {capacity}%"
},
"custom/cmus": {
"format": " {}",
"max-length": 30,
"interval": 1,
"exec": "now-playing.sh"
"max-length": 40,
"exec": "now-playing.sh",
"on-click": "playerctl play-pause",
"on-click-right": "playerctl stop",
"on-scroll-up": "playerctl next",
"on-scroll-down": "playerctl previous",
"escape": true
},
"custom/stat": {
"format": "{}",