put now-playing in quotes to avoid expansions

This commit is contained in:
whut 2023-05-08 11:25:26 -05:00
parent 3b27189081
commit dc873bc8b4

View File

@ -2,7 +2,7 @@
! pgrep mpd > /dev/null && mpd ! pgrep mpd > /dev/null && mpd
lastFile=/tmp/radioLast.$USER lastFile=/tmp/radioLast.$USER
nowPlaying=`mpc current -f "[%artist% - ]%title%"` nowPlaying=`mpc current -f "[%artist% - ]%title%"`
nowPlaying=`echo $nowPlaying | sed 's/&/\&amp;/g; s/</\&lt;/g; s/>/\&gt;/g; s/"/\&quot;/g; s/'"'"'/\&#39;/g'` nowPlaying=`echo "$nowPlaying" | sed 's/&/\&amp;/g; s/</\&lt;/g; s/>/\&gt;/g; s/"/\&quot;/g; s/'"'"'/\&#39;/g'`
width=$((${#nowPlaying} > 30 ? ${#nowPlaying} : 30)) width=$((${#nowPlaying} > 30 ? ${#nowPlaying} : 30))
if [ $# -eq 0 ]; then if [ $# -eq 0 ]; then