mirror of
https://git.in.rschanz.org/ryan77627/guix-config.git
synced 2024-11-07 11:06:15 -05:00
19 lines
461 B
Bash
Executable file
19 lines
461 B
Bash
Executable file
#!/bin/sh
|
|
|
|
class=$(playerctl metadata --format '{{lc(status)}}')
|
|
icon=""
|
|
|
|
if [[ $class == "playing" ]]; then
|
|
info=$(playerctl metadata --format '{{artist}} - {{title}}')
|
|
if [[ ${#info} > 40 ]]; then
|
|
info=$(playerctl metadata --format '{{title}}' | 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"\"}"
|
|
|