From: ds6 Date: Mon, 19 Feb 2018 12:00:18 +0000 (-0600) Subject: add mpc-notify X-Git-Url: https://git.sev.monster/~sev/dotfiles.git/commitdiff_plain/d2e125bc54cfba9396efc7e42ed5d5506fbc9c62 add mpc-notify --- diff --git a/base/.xinitrc b/base/.xinitrc index 12a9dc0..cd5b9cc 100755 --- a/base/.xinitrc +++ b/base/.xinitrc @@ -39,6 +39,7 @@ volumeicon & # daemons dunst & +mpc-notify & xautolock -time 10 -locker "$HOME/bin/l" & xbanish & eval `ssh-agent` diff --git a/bin/mpc-notify b/bin/mpc-notify new file mode 100755 index 0000000..370b6fe --- /dev/null +++ b/bin/mpc-notify @@ -0,0 +1,6 @@ +#!/bin/sh +replaces_id=0 +mpc idleloop player | while read -r x; do + #notify-send -u low -t 3000 -a mpc "`mpc current`" + replaces_id=$(expr "$(gdbus call --session --dest org.freedesktop.Notifications --object-path /org/freedesktop/Notifications --method org.freedesktop.Notifications.Notify mpc $replaces_id 'audio-volume-high' "`mpc current`" '' '[]' '{"urgency": }' 3000)" : '(uint32 \([0-9]*\),)') +done