dotfiles/scripts/cmus-new-song.sh
2024-11-04 20:23:14 +00:00

14 lines
373 B
Bash

#!/bin/sh
pidof -x playerctlup >/dev/null 2>&1 || playerctlup >/dev/null 2>&1 &
PLAYER_EVENT=$(playerctl status)
if [ "$PLAYER_EVENT" = "Playing" ] || [ "$PLAYER_EVENT" = "change" ];
then
trackName=$(playerctl metadata title)
artistAndAlbumName=$(playerctl metadata --format "{{ artist }} ({{ album }})")
notify-send -u low "$trackName" "$artistAndAlbumName "
fi