Ahti Kitsik
Building develper tools. Python, Java, JavaScript.

writings about @ahtik

Controlling the volume (xmonad, knobs)

By Ahti Kitsik, 18 Sep 2014

...

if [[ "$1" = "toggle" ]]; then amixer -D pulse set Master toggle fi # This lock is needed for the "extreme" volume controllers like digital soundcards that have volume buttons. Regular keyboard is fireing events slower so the lock will not trigger. ( flock -n 9 || exit 1 # ... commands executed under lock ... # ) 9>~/.volume.lock if [[ "$1" = "+5%" ]]; then # sink=`pactl list sinks|grep "Name: "|cut -d" " -f2` # pactl set-sink-volume 0 +5% amixer -q -D pulse sset Master 2%+ unmute fi if [[ "$1" = "-5%" ]]; then # pactl set-sink-volume 0 -- -5% amixer -q -D pulse sset Master 2%- unmute fi ) 9>~/.volume.lock

@ahtik is on twitter!