aboutsummaryrefslogtreecommitdiff
path: root/bin/mpdlrc-notify-send
blob: 994c382d5180db8ce4d9fde774bcce1a5a7a8dcf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/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)