30 lines
724 B
Bash
Executable File
30 lines
724 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# Script to display notifcation when song changes
|
|
# Requires:
|
|
# libnotify or dunstify
|
|
# mpd
|
|
# mpc
|
|
|
|
app_name="MPD Status"
|
|
summary="Now Playing"
|
|
|
|
if [[ "$MUSIC_NOTIFY" != "true" ]]; then
|
|
echo "Not sending notifications, MUSIC_NOTIFY isn't true"
|
|
elif command -v dunstify; then
|
|
while :; do
|
|
dunstify -a "${app_name}" \
|
|
-t 4000 \
|
|
-r 13596705 \
|
|
"${summary}" \
|
|
"$(mpc current --wait)"
|
|
done
|
|
else
|
|
while :; do
|
|
notify-send -t 4000 \
|
|
-a "${app_name}" \
|
|
"${summary}" \
|
|
"$(mpc current --wait)"
|
|
done
|
|
fi
|