#!/usr/bin/env bash name="$(mpc -f '%title%' | head -1)" offline="$(echo $name | grep -E 'volume:|MPD')" if [[ $offline ]] then name="MPD off" else name="$name" fi echo  $name