Browse Source

Filter volume changes

master
Arti Zirk 5 years ago
parent
commit
7447134242
  1. 10
      .bin/volume_subscribe.sh
  2. 2
      .config/sway/config

10
.bin/volume_subscribe.sh

@ -0,0 +1,10 @@ @@ -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

2
.config/sway/config

@ -54,7 +54,7 @@ exec mako --default-timeout 10000 @@ -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

Loading…
Cancel
Save