Improved algorithm aimed to be used with polybar
This commit is contained in:
parent
3fb64b18b0
commit
14d27eb3be
@ -1,8 +1,17 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
s=$( playerctl -f '{{trunc(xesam:artist, 20)}} - {{trunc(xesam:title, 30)}}' metadata )
|
stat=$( playerctl status )
|
||||||
if [ $? -eq 0 ]; then
|
msg=$( playerctl -f '{{trunc(xesam:artist, 15)}} - {{trunc(xesam:title, 30)}}' metadata )
|
||||||
echo "$s"
|
if [ "$stat" = "Playing" ]; then
|
||||||
|
if [ "$msg" = " - " ]; then
|
||||||
|
echo "No metadata"
|
||||||
|
else
|
||||||
|
echo "$msg"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo ""
|
if [ "$stat" = "Paused" ]; then
|
||||||
|
echo "Paused"
|
||||||
|
else
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
exit 0
|
exit 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user