#!/bin/bash status=$(playerctl status 2>/dev/null) if [ "$status" = "Playing" ] || [ "$status" = "Paused" ]; then title=$(playerctl metadata title | sed 's/&/\&/g; s//\>/g') artist=$(playerctl metadata artist | sed 's/&/\&/g; s//\>/g') if [ ${#title} -gt 25 ]; then title="${title:0:22}..."; fi if [ ${#artist} -gt 25 ]; then artist="${artist:0:22}..."; fi echo "$title" echo "$artist" else echo "No Media" echo "Idling" fi