now-playing: tweaks
This commit is contained in:
parent
0e8a5c2c12
commit
ca3ef3185e
|
@ -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
|
|
@ -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": "{}",
|
||||
|
|
Loading…
Reference in New Issue