Visual Volume Display (vvd)

Various KDE 1.-4. Improvements

Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net

0
Score 50.0%
Description:

README
VVD (Visual Volume Display)
Version 1.5
Jeshua Bratman (jeshuabratman@gmail.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.


DESCRIPTION
-----------

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.


REQUIREMENTS
------------

* 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/regex)
* boost program options
(boost/program_options)
* amixer
(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.)


INSTALL
-------

$ make
$ su -c "make install"
OR
$ sudo make install


RUN
---

$ vvd [options]


$ ./vvd -h
VVD Options:
-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+)



EXAMPLES:
---------

$ 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


BIND HOTKEYS
------------

*for kde hotkeys*
kcontrol -> regional & accessibility -> input actions

*for xbindkeys*
edit .xbindkeysrc
#E.G. vol_up
"vvd PCM 5+"
m:0x10 + c:123
Mod2 + XF86AudioRaiseVolume


USING DAEMON MODE
------------
$ vvd --daemon-mode
OR
$ sh vvd-daemon.sh start

to make it start on kde startup

make a file " ~/.kde/Autostart/start-vvd-daemon":
#!/bin/bash
vvd-daemon.sh start

$ chmod +x ~/.kde/Autostart/start-vvd-daemon
Last changelog:

11 years ago

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

ndlarsen

11 years ago

Think you might have forgotten a #include<string.h> in Queue.cpp.
Any chance there will be some sort versions applied to the releases? (for package management reasons)

Cheers

Report

C

jeshuabratman

11 years ago

Yeah, I'll put version numbers on it in the future. Thanks for pointing out the include. For some reason when I compile it on my system it works fine, but I tried it on another system and it failed so it just must be some configuration thing.

Let me know if you have any ideas to improve the application, and thanks for the interest.

Regards,
Jeshua Bratman

Report

ndlarsen

11 years ago

Think you might have forgotten a #include<string.h> in Queue.cpp.
Any chance there will be some sort versions applied to the releases? (for package management reasons)

Cheers

Report

blakeyed

11 years ago

I liked it so much, simple and great!

Perfect replace for my amixer/xosd script running on fluxbox

Congratulations

Report

C

jeshuabratman

11 years ago

glad you like it!

Report

Zeeuw

12 years ago

Hi,

I agree that kde's volume bar doesn't work very well, but I don't think you just solved it. I tried your program, and it works from the command line. But setting these shortcuts to execute your program just isn't the right solution i think. It isn't very user friendly.
I was thinking about a plasma widget with some eyecandy which would pop up when you pressed the volume keys.
Amarok already has this sort of osd when you lower or raise the volume in amarok.

Report

C

jeshuabratman

12 years ago

Thanks for trying my app first of all.

The reason I chose to make a program which can be run from the command line as opposed to some sort of daemon which bound hotkeys was because I felt it unnecessary to redesign a whole hotkey system which was already available through KDE.

Also, using vvd from the command line allows you to have a unifed onscreen display for multiple methods of changing the volume. For example, I have volume keys on my keyboard which I bind to vvd PCM 5+/5-, as well as a remote control with the volume keys bound to vvd PCM 10+/10- (because the repeat rate is lower).

The reason I didn't make a plasma or karamba widget is because I don't use either. Maybe there will be a better solution in KDE4.

You say its not very user friendly, which may be true, but I think if you've had a little experience with linux command line and kde hotkeys, it is pretty easy to set up. In any case it wasn't designed to be a quick fix automatic solution. It was designed to be a solution which worked.

Lastly, you mention eye candy. I mean to spice up the actual volume bar today.

Report

Zeeuw

12 years ago

I'm liking it a bit more now i actually managed to add a shortcut to the program. I first had to edit the menu and add vvd. I didn't compile vvd myself, i used the binary instead. When i tried to compile it, i got an error. It says that boost/regex.hpp is missing. Will there be made a menu shortcut when you compile the program? Because that would make it a bit more user friendly.
About plasma: when you're using KDE4, i think you will be using plasma, as it's an important part of kde (panel is plasma and amarok uses it, for example)
You say you don't want to redesign the shortcut system, but can't you make a small dialog which uses the same components that kcontrol uses to setup shortcuts? Isn't there a standard library or so for it?
2 features i would like to see are a mute function and to be able to decide where the bar will show. It's shows in the upper left corner right know, and i would like to have it up in the center.

Report

C

jeshuabratman

12 years ago

Mute is a good idea. Amixer has a command 'toggle' which mutes/unmutes the channel. I'll make it so you can send vvd this command "vvd Front toggle"

I'll re-enable the centering of the volume display. The problem I have with it right now is I use the primary display to center the volume bar, which in my case is my right monitor. I would rather have it center on the monitor where the mouse is located (I'm working on this) since I use my left monitor more often.

As for the menu shortcuts you're talking about, I don't know much about these. Something to do with .desktop files right? In any case you can make a hotkey directly to the command using kcontrol:

kcontrol->regional & accessibility -> input actions

create a new action, select keyboard shortcut->command/url. In the command/url tab type vvd PCM 5+ or whatever.

Report

Zeeuw

12 years ago

I like the new version :)
It would by the way be useful if you used versions, so we can see whether we have to update or not.
For myself, i added this line: qApp->setStyleSheet("QWidget { background-color: #535353 }");
I don't know if it's the right method, but i found it in the qt docs and it works. On my laptop, i have installed kubuntu, and it contains an application that does the same as vvd (if it had worked) and has about the same color i added. I think it looks better now :)

I configured the shortcuts as following: i started kmenuedit, added 3 new programs (volume_up, volume_down and volume_toggle). I configured the commands ('/usr/bin/vvd' Front toggle for example) and deactivated the startup notification. (that's an important one, else, you will fill your complete taskbar after changing the volume a few steps :P)
One disadvantage of vvd that kmix doesn't have, is the delay. In kmix, i could easily hold my volume up button until i reached the right volume, and then release the volume button. With vvd, i have to release it much earlier because of the delay. I don't know whether this is solvable?

Report

C

jeshuabratman

12 years ago

Glad you like the new version!

There's no delay for me. Maybe the delay has to do with using kmenuedit to do the hotkeys. Try using kcontrol->accessibility->input actions instead Let me know if that fixes it..

I will do version numbers in the future. I figured I wouldn't worry about it at first because I didn't know if I was going to keep working on it at all.

As for the background color, I need to learn a bit more about QT because I'm pretty sure it should have the background color that you set up in kcontrol (rather than explicitly changing the color). I'm mostly a gtk guy, but I thought I'd learn QT (which I like alot). This project was just my first qt program so I have alot to learn still.

for next version:
*config file to specify a few things such as xinerama screen to display on, size, screen location, time until it disapears etc.
*make it use the qt style specified in kcontrol
*command line args for everything in the config file (maybe)

Report

Zeeuw

12 years ago

Maybe delay isn't the right term. What i mean is that when i keep the volume up pressed for a while, and then release it, it doesn't directly stop, but keeps going a little bit.

About the background color: i personally don't like to have it the same background as the other programs do. VVD doesn't look like an application, more like a plasmoid or so. That's why i made the background dark gray, while the background of programs is light gray.
I just searched for background in the trolltech documentation, i don't know qt very well (i don't know c++ very well either)
The changes about the config files sound nice

(i'm by the way not using gentoo anymore, as i spend too much time compiling :P)

Report

Zeeuw

12 years ago

Ahum, i forgot to check the dependencies. Installing boost-devel solved the problem :$

Report

C

jeshuabratman

12 years ago

Did you like having the binary in the tar file? I actually put it in there on accident, I meant to just upload the source and makefile.

Report

Zeeuw

12 years ago

For me it's not necessary, because i used to compile my complete installation (gentoo :P), so i'm used to it. It could be easier for some people who are having troubles with compiling, but on the other hand, i don't think they'll be able to configure vvd if they can't even compile it :P (i learned how to compile a program before i learned how to set up shortcuts)
I would deliver just the source, it saves even some bandwidth ;)

Report

C

jeshuabratman

12 years ago

Yay Gentoo. That's what I use as well.

Report

11 years ago

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

12345678910
product-maker Base: 4 x 5.0 Ratings
File (click to download) Version Description PackagetypeArchitecture Downloads Date Filesize DL OCS-Install MD5SUM
*Needs pling-store or ocs-url to install things
Pling
0 Affiliates
Details
license
version
1.5
updated Jan 11 2009
added Jan 10 2008
downloads 24h
0
mediaviews 24h 0
pageviews 24h 1