|Submitted: Jan 10 2008|
Updated: Jan 12 2009
VVD (Visual Volume Display)
Jeshua Bratman (email@example.com)
For the longest time I have been irritated with the volume control in KDE. Sometimes KDE will automatically bind my keyboard volume keys to kmix and display a volume bar when I press volume up or down. However, sometimes this stops working for some reason I have yet to figure out. Although there are several ways to bind volume keys, they are usually not straightforward rely on poorly made keyboard listening daemons. I prefer to rely on more testing hotkey programs such as KDE's input actions (well it worked well in kde 3...) or xbindkeys (which works great in any desktop).
VVD is tiny app which allows you to easily change alsa volume, or mute a channel while at the same time displaying a visual representation of the volume. This is useful for binding volume hotkeys. For example, use kde input actions, or xbindkeys to bind a volume up key to the command "vvd Front 10+".
Unlike using kmix, this allows you to bind more than one hotkey to change the volume, and maybe even several hotkeys to change the volume of different channels. All it relies on is amixer to change the volume and whatever hotkey program you want to use. This way it is much more reliable than kmix or most of the other volume controls out there.
All in all, vvd makes it easier to have a working visual volume indicator in linux.
The first time you run vvd, it executes the specified amixer command and displays a volume bar at the top of the screen. If you run vvd again before this first instance has closed (after 800ms -- by default), the second instance will put a message on a message queue which the first instance will read, send to amixer, and update the volume bar as well as resetting the exit timer to 800ms. This is ideal for the key repeat of volume control keys allowing vvd to appear smooth even as multiple instance are opened.
Because it seems to take a couple seconds to load the qt libraries into memory sometimes (I haven't experienced this but some other people have), VVD may seem sluggish in starting the first time you run it. This is not desirable if you want a fast reaction to a hotkey. If your computer is fast enough you probably won't even notice this, but to alleviate this problem and option exists in VVD to allow it to run in the background as a daemon. If you run 'vvd daemon-mode' vvd will run without displaying any QT window, but it will create this window for you and listen on the message queue for commands. The script vvd-daemon.sh has been provided to launch vvd as a daemon.
* QT 4.x
(I'm not sure if you really need 4.3, but that's what I'm using)
* qmake 4.x
* boost regex library
* boost program options
(vvd utilizes the amixer program. It WILL not function if you don't have this. I always user alsa on my system. If anyone is using another sound system and would like vvd to work for it, let me know. It might be easy to adapt.)
$ su -c "make install"
$ sudo make install
$ vvd [options]
$ ./vvd -h
-h [ --help ] display help
-d [ --daemon-mode ] run vvd in daemon mode
-t [ --timeout ] arg (=800) set visible window timeout
-w [ --width ] arg (=350) set window width
-h [ --height ] arg (=30) set window height
Usage: vvd [options] (e.g. vvd Front 5+)
$ vvd PCM 5+
$ vvd Front 20-
MUTE COMMANDS (note that you cannot mute PCM channel)
$ vvd Front toggle #toggles mute
$ vvd Front mute
$ vvd Front unmute
*for kde hotkeys*
kcontrol -> regional & accessibility -> input actions
"vvd PCM 5+"
m:0x10 + c:123
Mod2 + XF86AudioRaiseVolume
USING DAEMON MODE
$ vvd --daemon-mode
$ sh vvd-daemon.sh start
to make it start on kde startup
make a file " ~/.kde/Autostart/start-vvd-daemon":
$ chmod +x ~/.kde/Autostart/start-vvd-daemon
Jan. 11 2009 - Version 1.5 (yes, I picked that number arbitrarily). Added some options and fixed a few little bugs. Also fixed includes in Queue.hpp. Command line parameters are now parsed with boost program options. All old scripts should still work except for daemon mode. Now to launch daemon mode you need the dashes like so: "vvd --daemon-mode" or "vvd -d".
Jan. 1 2009 - Just changed description a bit.
Sep. 1 2008 - Uploaded new version with a few changes including daemon mode. Now you can run vvd in the background as a daemon to improve response time.
Jan. 10 2008 - Added mute and toggle commands. Also the volume bar is centered on the primary screen.
Jan. 10 2008 - uploaded vvd