shell/mpd/bin/notify-song.sh: silence errors; put rating on top of notification

This commit is contained in:
Henrik Lissner 2017-01-17 23:23:29 -05:00
parent d109f901fc
commit cbfb2a8377

View file

@ -51,11 +51,14 @@ fi
case $OSTYPE in case $OSTYPE in
darwin*) darwin*)
rating="[$rating] " [[ $rating ]] && rating="[$rating] "
killall terminal-notifier killall terminal-notifier
terminal-notifier -title "$rating$title" -message "by $artist :: $album" -appIcon "/Applications/iTunes.app/Contents/Resources/iTunes.icns" terminal-notifier -title "$rating$title" -message "by $artist :: $album" -appIcon "/Applications/iTunes.app/Contents/Resources/iTunes.icns"
;; ;;
linux*) linux*)
notify-send --icon="media-playback-start" --app-name="ncmpcpp" "$title" "${artist}\n<i>${album}</i>\n$rating" [[ $rating ]] && rating="$rating\n"
notify-send --icon="media-playback-start" --app-name="ncmpcpp" "$rating$title" "${artist}\n<i>${album}</i>"
;; ;;
esac & esac >/dev/null 2>&1 &
exit 0