Created
May 19, 2020 12:40
-
-
Save jn64/8b412733667e30bf63bf9d4ba1852691 to your computer and use it in GitHub Desktop.
ncmpcpp notifications with album art
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Send notification with album art when ncmpcpp plays a new song | |
# execute_on_song_change must be set in ncmpcpp config | |
readonly MUSIC_DIR="${HOME}/Music/Library" | |
readonly SONG_PATH="$(mpc --format '%file%' current)" | |
readonly SONG_DIR="$(dirname "${SONG_PATH}")" | |
readonly ALBUM_ART_PATH="${MUSIC_DIR}/${SONG_DIR}/cover.jpg" | |
# if [[ ! -f "${ALBUM_ART_PATH}" ]]; then # file doesn't exist | |
# ALBUM_ART_PATH="" # TODO: insert path to generic icon here | |
# fi | |
notify-send -i "${ALBUM_ART_PATH}" "Now Playing" "$(mpc --format '%title% - %artist%' current)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment