Skip to Content

Volume control and notification

Posted on

My original intent was to manage sound on my laptop by binding the commands to the multimedia keys in ~/.xbindkeysrc. Instead xbindkeys calls a standalone script I created to control PulseAudio volume (and thus useful beyond just xbindkeys).

Let’s go!

Script requirements: pactl, pamixer, and volnoti.

0. Pactl

Pactl controls a PulseAudio sound server and is included in pulseaudio-utils

sudo apt install pulseaudio-utils

1. Pamixer

Pamixer is a PulseAudio console mixer. Compile dependencies …

sudo apt install build-essential libpulse-dev libboost-program-options1.62.0:amd64 libboost-program-options-dev

Download source and compile …

git clone https://cdemoulins@github.com/cdemoulins/pamixer.git
cd pamixer
make

No make install. Place the resulting pamixer in PATH (I use ~/bin).

2. Volnoti

Volnoti is a lightweight volume notification utility. More: Compile and install programs in $HOME

3. Script paVolume

🐧 $HOME Slash Bin :: I tie all the pieces together with my paVolume shell script and create keycodes to increase/decrease/mute volume in ~/.xbindkeysrc

"paVolume -m"
F8
"paVolume -m"
XF86AudioMute
"paVolume -d"
F9
"paVolume -d"
XF86AudioLowerVolume
"paVolume -u"
F10
"paVolume -u"
XF86AudioRaiseVolume

🐧 Part of the HOME slash bin project.

Sources: paVolume and .xbindkeysrc.chromebook

Happy hacking!