This repository has been archived on 2022-03-04. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/dunst/.config/dunst/music-change.sh

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