feat(ncmpcpp): cross-platform notify

This commit is contained in:
winston 2022-11-04 11:25:50 +01:00
parent 2f8ad7808e
commit 531e4dee02
Signed by: winston
GPG key ID: 3786770EDBC2B481
2 changed files with 22 additions and 5 deletions

View file

@ -4,15 +4,21 @@ mpd_port = 6600
mpd_music_dir = ~/Music mpd_music_dir = ~/Music
mpd_connection_timeout = 5 mpd_connection_timeout = 5
visualizer_data_source = localhost:5555
enable_window_title = no enable_window_title = no
external_editor = nvim external_editor = nvim
use_console_editor = yes use_console_editor = yes
execute_on_song_change = notify-send -a "ncmpcpp" "Now playing" "$(mpc --format '%title% \n%artist% - %album%' current)" execute_on_song_change = ~/.config/mpd/notify.sh
visualizer_data_source = "/tmp/mpd.fifo"
visualizer_output_name = "my_fifo"
visualizer_in_stereo = "yes"
visualizer_type = "spectrum"
visualizer_look = "+█"
# looks
user_interface = alternative user_interface = alternative
alternative_header_first_line_format = $b$1$aqqu$/a$9 {%t}|{%f} $1$atqq$/a$9$/b alternative_header_first_line_format = $b$1$aqqu$/a$9 {%t}|{%f} $1$atqq$/a$9$/b
alternative_header_second_line_format = {{$4$b%a$/b$9}{ - $7%b$9} }|{%D} alternative_header_second_line_format = {{$4$b%a$/b$9}{ - $7%b$9} }|{%D}
@ -20,5 +26,3 @@ autocenter_mode = yes
progressbar_look = ═▶ progressbar_look = ═▶
progressbar_color = black:b progressbar_color = black:b
progressbar_elapsed_color = magenta:b progressbar_elapsed_color = magenta:b
song_status_format = {{%b by %a - }{%t}}|{%f}

View file

@ -0,0 +1,13 @@
#!/usr/bin/env sh
if ! command -v mpc >/dev/null 2>&1; then
exit 1
fi
if [ $(uname -s) = "Darwin" ]; then
terminal-notifier -title "Now playing" -message "$(mpc --format '%title% \n%artist% - %album%' current)" -group "org.musicpd" > /dev/null
fi
if [ $(uname -s) = "Linux" ]; then
notify-send "Now playing" "$(mpc --format '%title% \n%artist% - %album%' current)" -u low -t 5000 -a "mpd"
fi