#!/usr/bin/bash MCLASS=$(playerctl metadata --player=spotify --format '{{lc(status)}}') MICON="🎵" if [[ $MCLASS == "playing" ]]; then MINFO=$(playerctl metadata --player=spotify --format '{{artist}} - {{title}}') if [[ ${#MINFO} > 35 ]]; then MINFO=$(echo $MINFO | cut -c1-35)"..." fi MTEXT=" "$MICON" "$MINFO" " elif [[ $class == "paused" ]]; then MTEXT=$MICON" (paused) " elif [[ $class == "stopped" ]]; then MTEXT="" fi printf "$MTEXT"