dotfiles/themes/dracula/.config/waybar/modules/spotify.sh
ManOfGoldForever b043d2807d Migrate from stow to dm theme manager
Move all config files from .config/ into themes/dracula/.config/ so the
dm tool can manage them as file-level symlinks. Removes .bak file.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 00:41:10 -04:00

18 lines
478 B
Bash
Executable file

#!/bin/sh
class=$(playerctl metadata --player=spotify_player --format '{{lc(status)}}')
icon=""
if [[ $class == "playing" ]]; then
info=$(playerctl metadata --player=spotify_player --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"\"}"