big bang
This commit is contained in:
commit
c28a6769ac
10 changed files with 578 additions and 0 deletions
33
waybar/modules/spotify.sh
Executable file
33
waybar/modules/spotify.sh
Executable file
|
@ -0,0 +1,33 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
class=$(playerctl metadata --player=firefox --format '{{lc(status)}}')
|
||||
icon=" "
|
||||
|
||||
if [[ $class == "playing" ]]; then
|
||||
info=$(playerctl metadata --player=firefox --format '{{title}}')
|
||||
if [[ ${#info} > 60 ]]; then
|
||||
info=$(echo $info | cut -c1-60)"..."
|
||||
fi
|
||||
text=$info" "$icon
|
||||
elif [[ $class == "paused" ]]; then
|
||||
text=$icon
|
||||
elif [[ $class == "stopped" ]]; then
|
||||
text=""
|
||||
fi
|
||||
|
||||
classa=$(playerctl metadata --player=spotify --format '{{lc(status)}}')
|
||||
|
||||
if [[ $classa == "playing" ]]; then
|
||||
icon=""
|
||||
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"\"}"
|
Loading…
Add table
Add a link
Reference in a new issue