diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2015-12-05 13:00:45 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2015-12-05 13:00:45 +1300 |
commit | 4419fac56154a1cc39bca7b6abd0c80c6e0b3194 (patch) | |
tree | aaf5ba7bf569af50a058a664581f705e1c0fe595 /bin/mpdlrc-notify-send | |
parent | Add mplrc-notify-send example (diff) | |
download | mpdlrc-4419fac56154a1cc39bca7b6abd0c80c6e0b3194.tar.gz mpdlrc-4419fac56154a1cc39bca7b6abd0c80c6e0b3194.zip |
Move scripts into bin subdir
Diffstat (limited to 'bin/mpdlrc-notify-send')
-rwxr-xr-x | bin/mpdlrc-notify-send | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/bin/mpdlrc-notify-send b/bin/mpdlrc-notify-send new file mode 100755 index 0000000..977cf1b --- /dev/null +++ b/bin/mpdlrc-notify-send @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +# Check we have the two programs we need +hash mpdlrc || exit +hash notify-send || exit + +# Read the priority and timeout from the environment, or set default values +priority=${MPDLC_PRIORITY:-low} +timeout=${MPDLC_TIMEOUT:-2000} + +# Loop over each line output by mpdlrc (which will need to be somewhere in your +# PATH) and pass it to notify-send(1) +while IFS= read -r lyric ; do + notify-send -u "$priority" -t "$timeout" "$lyric" +done < <(mpdlrc) + |