Filter volume changes

This commit is contained in:
Arti Zirk 2020-04-16 15:55:35 +03:00
parent 6c2002242c
commit 7447134242
2 changed files with 11 additions and 1 deletions

10
.bin/volume_subscribe.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash
OLD_VOL=0
pactl subscribe | grep --line-buffered "sink" |
while read; do
VOL=$(amixer get Master | grep -Po "[0-9]+(?=%)" | tail -1)
if [[ $VOL != $OLD_VOL ]]; then
tvolnoti-show $VOL
OLD_VOL=$VOL
fi
done

View File

@ -54,7 +54,7 @@ exec mako --default-timeout 10000
exec tvolnoti -n -T dark
# Monitor volume changes
exec pactl subscribe | grep --line-buffered "sink" | xargs -n1 sh -c 'tvolnoti-show $(amixer get Master | grep -Po "[0-9]+(?=%)" | tail -1)'
exec ~/.bin/volume_subscribe.sh
# Register a fake player in bluez so that volume control would work
exec ~/.bin/fakebluezplayer.py