This commit is contained in:
Yusuf İpek
2023-06-01 17:45:20 +03:00
parent 075c3c7b1a
commit da3a33c689
12 changed files with 1374 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
#!/bin/sh
class=$(playerctl metadata --player=spotify --format '{{lc(status)}}')
icon=""
if [[ $class == "playing" ]]; then
info=$(playerctl metadata --player=spotify --format '{{artist}} - {{title}}')
if [[ ${#info} > 40 ]]; then
info=$(echo $info | cut -c1-40)"..."
fi
text=$info" "$icon
elif [[ $class == "paused" ]]; then
text=$icon
elif [[ $class == "stopped" ]]; then
text=""
fi
echo -e "{\"text\":\""$text"\", \"class\":\""$class"\"}"