properly handle songs w/o album art
This commit is contained in:
parent
a08c137343
commit
5c4d03eaa1
2 changed files with 12 additions and 5 deletions
|
|
@ -6,6 +6,9 @@ while read L; do
|
||||||
export "$k=$v"
|
export "$k=$v"
|
||||||
done < <(grep -e '^\(title\|artist\|album\|stationName\|songStationName\|pRet\|pRetStr\|wRet\|wRetStr\|songDuration\|songPlayed\|rating\|coverArt\|stationCount\|station[0-9]*\)=' "$HOME/.config/pianobar/info")
|
done < <(grep -e '^\(title\|artist\|album\|stationName\|songStationName\|pRet\|pRetStr\|wRet\|wRetStr\|songDuration\|songPlayed\|rating\|coverArt\|stationCount\|station[0-9]*\)=' "$HOME/.config/pianobar/info")
|
||||||
|
|
||||||
|
if [ -z "$coverArt" ]; then
|
||||||
|
notify-send "Now playing:" "$title by $artist on $album"
|
||||||
|
else
|
||||||
curl "$coverArt" --silent --output "$HOME/.config/pianobar/album.jpg"
|
curl "$coverArt" --silent --output "$HOME/.config/pianobar/album.jpg"
|
||||||
|
|
||||||
notify-send "Now playing:" "$title by $artist on $album" --icon="$HOME/.config/pianobar/album.jpg"
|
notify-send "Now playing:" "$title by $artist on $album" --icon="$HOME/.config/pianobar/album.jpg"
|
||||||
|
fi
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,12 @@ done < <(grep -e '^\(title\|artist\|album\|stationName\|songStationName\|pRet\|p
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
songstart)
|
songstart)
|
||||||
|
if [ -z "$coverArt" ]; then
|
||||||
|
notify-send "Now playing:" "$title by $artist on $album"
|
||||||
|
else
|
||||||
curl "$coverArt" --silent --output "$HOME/.config/pianobar/album.jpg"
|
curl "$coverArt" --silent --output "$HOME/.config/pianobar/album.jpg"
|
||||||
notify-send "Now playing:" "$title by $artist on $album" --icon="$HOME/.config/pianobar/album.jpg"
|
notify-send "Now playing:" "$title by $artist on $album" --icon="$HOME/.config/pianobar/album.jpg"
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
;;
|
;;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue