From 6490354346dc941b19535e4d74b242610cdfd7e9 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 24 Dec 2016 15:58:01 -0500 Subject: [PATCH] +scripts/notify-song.sh --- scripts/notify-song.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 scripts/notify-song.sh diff --git a/scripts/notify-song.sh b/scripts/notify-song.sh new file mode 100755 index 00000000..06b72a01 --- /dev/null +++ b/scripts/notify-song.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +if ! pgrep mpd >/dev/null; then + >&2 echo "mpd isn't running." + exit 1 +fi + +info=$(mpc current) +if [[ -z $info ]]; then + >&2 echo "nothing is playing." + exit +fi + +notify-send --icon="media-playback-start" --app-name="ncmpcpp" "Now playing" "$info"