mirror of https://github.com/tiyn/dotfiles
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
911 B
39 lines
911 B
10 months ago
|
#!/bin/sh
|
||
|
|
||
|
playerctlstatus=$(playerctl status 2> /dev/null)
|
||
|
track="$(playerctl metadata "xesam:artist") - $(playerctl metadata "xesam:title")"
|
||
|
track=$(echo "$track" | cut -c1-40)
|
||
|
loop=$(playerctl loop)
|
||
|
shuffle=$(playerctl shuffle)
|
||
|
|
||
|
if [ "$loop" = "Playlist" ]
|
||
|
then
|
||
|
loop_icon="^b#282828^^c#dfdfdf^ ^d^"
|
||
|
elif [ "$loop" = "Track" ]
|
||
|
then
|
||
|
loop_icon="^b#282828^^c#dfdfdf^ ^d^"
|
||
|
elif [ "$loop" = "None" ]
|
||
|
then
|
||
|
loop_icon="^b#282828^^c#dfdfdf^ ^d^"
|
||
|
fi
|
||
|
|
||
|
if [ "$shuffle" = "Off" ]
|
||
|
then
|
||
|
shuffle_icon="^b#282828^^c#dfdfdf^ ^d^"
|
||
|
elif [ "$shuffle" = "On" ]
|
||
|
then
|
||
|
shuffle_icon="^b#282828^^c#dfdfdf^ ^d^"
|
||
|
fi
|
||
|
|
||
|
|
||
|
if [ "$playerctlstatus" = "" ]
|
||
|
then
|
||
|
echo ""
|
||
|
elif [ "$playerctlstatus" = "Playing" ]
|
||
|
then
|
||
|
echo "$track ^b#282828^^c#dfdfdf^ ▶️ ^d^ $loop_icon $shuffle_icon"
|
||
|
elif [ "$playerctlstatus" = "Paused" ]
|
||
|
then
|
||
|
echo "^b#282828^^c#dfdfdf^ ^d^ $loop_icon $shuffle_icon"
|
||
|
fi
|