[volcont] Add support for dunst notifications
This commit is contained in:
parent
bc147b4db3
commit
0fee4131e5
2 changed files with 12 additions and 6 deletions
|
@ -2,6 +2,7 @@
|
||||||
while true; do
|
while true; do
|
||||||
$@ &
|
$@ &
|
||||||
PID=$!
|
PID=$!
|
||||||
inotifywait $1
|
sleep 1
|
||||||
|
inotifywait $1 # FIXME: that's not the file
|
||||||
kill $PID
|
kill $PID
|
||||||
done
|
done
|
||||||
|
|
15
volcont
15
volcont
|
@ -4,8 +4,9 @@
|
||||||
# Taken from http://customlinux.blogspot.fr/2013/02/pavolumesh-control-active-sink-volume.html
|
# Taken from http://customlinux.blogspot.fr/2013/02/pavolumesh-control-active-sink-volume.html
|
||||||
# and slightly adapted by lhark to work with notify-send
|
# and slightly adapted by lhark to work with notify-send
|
||||||
|
|
||||||
notify='yes'
|
notify='dunst' # no/yes/dunst
|
||||||
notiftime='400'
|
notiftime='400'
|
||||||
|
notifid='42'
|
||||||
inc='2'
|
inc='2'
|
||||||
capvol='yes'
|
capvol='yes'
|
||||||
maxvol='200'
|
maxvol='200'
|
||||||
|
@ -41,13 +42,13 @@ volUp () {
|
||||||
|
|
||||||
getCurVol
|
getCurVol
|
||||||
|
|
||||||
if [ ${notify} = 'yes' ]
|
if [ ${notify} = 'yes' ]; then
|
||||||
then
|
|
||||||
notify-send "Volume : ${curVol}%" -t ${notiftime}
|
notify-send "Volume : ${curVol}%" -t ${notiftime}
|
||||||
|
elif [ "$notify" = 'dunst' ]; then
|
||||||
|
dunstify -r "$notifid" -t "$notiftime" "Volume: $curVol%"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ${autosync} = 'yes' ]
|
if [ ${autosync} = 'yes' ]; then
|
||||||
then
|
|
||||||
volSync
|
volSync
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -61,6 +62,8 @@ volDown () {
|
||||||
|
|
||||||
if [ ${notify} = 'yes' ]; then
|
if [ ${notify} = 'yes' ]; then
|
||||||
notify-send "Volume : ${curVol}%" -t ${notiftime}
|
notify-send "Volume : ${curVol}%" -t ${notiftime}
|
||||||
|
elif [ "$notify" = 'dunst' ]; then
|
||||||
|
dunstify -r "$notifid" -t "$notiftime" "Volume: $curVol%"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ${autosync} = 'yes' ]; then
|
if [ ${autosync} = 'yes' ]; then
|
||||||
|
@ -104,6 +107,8 @@ volMute () {
|
||||||
|
|
||||||
if [ ${notify} = 'yes' ]; then
|
if [ ${notify} = 'yes' ]; then
|
||||||
notify-send "$([ "${status}" = 1 ] && echo "Sound muted" || echo "Sound unmuted")" -t ${notiftime}
|
notify-send "$([ "${status}" = 1 ] && echo "Sound muted" || echo "Sound unmuted")" -t ${notiftime}
|
||||||
|
elif [ "$notify" = 'dunst' ]; then
|
||||||
|
dunstify -r "$notifid" -t "$notiftime" "$([ "${status}" = 1 ] && echo "Sound muted" || echo "Sound unmuted")"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue