Volcont – simple alsa volume control

This is a small Gtk Status Icon I wrote in C to adjust the volume on Linux based OS with the alsa sound driver.

It is designed to be as light as possible so don’t expect too much in the way of features. I wrote it for the Raspberry Pi computer, which as a desktop is a bit slow however is usable so long as you run a feather weight desktop. I use JWM .

The code is just 70 lines of C and only depends on Gtk and alsamixer. There is no configure script, just build it with the compile script included in the source and install it wherever you want. I put it in /usr/local/bin and run it at the startup of X with the JWM StartCommand tag in my ~/.jwmrc file.The XPM icon is compiled in. You could if you want replace it with something a bit fancier but it must be a valid XPM. By default it’s hard coded to be linked to gtk+-2.0 but there is no reason you couldn’t link it to gtk+-3.0. I have done this before with status icons I have written.

There is one special option to the compile script. If you run Raspbian on your Pi then pass the “raspbian” option to the script like so (I think Arch for Pi is hard float too, so you could try it there):

./compile raspbian

This adds some special options to gcc to compile the binary with the hard float abi and also optimise it for size. The binary ends up only 6k, including the icon.

Here’s what it looks like:

volcont pic
Running volcont on Raspbian with JWM

You can download the source code tarball from here. Just extract, compile install and enjoy! It’s distributed under the GPLv2 so you can hack it, share it, do pretty much whatever you like except claim that you wrote it!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s