When I start to use awesome my first concern was about audio
handling.. just 2 simple tasks:
1. Change volume
2. Toggle mute.

For some time I just hardcode the whole thing on my rc.lua, but then
it start to get to confuse and I moved to another file. I use the same
configuration on my desk and notebook. I use alsa + pulseaudio and
create a "kind of" wraper to amixer command.

It makes me pleased, I need only change one string when I change my
environment. But still there is a problem. If I hold volume raise or
low key my cpu gets to 100% and widget is not updated as I want... It
hangs for a while and about 2 secs after I release the button to get
updated.. so I need to raise/low volume by tapping... I expect to have
widget updated smooth while I hold the key so I just release when is
about to the volume that I want..

If people can help to get this better, I would be very happy, but if
there is simpler and better solutions out there, then let me know too
please! This setup is from when I start with awesome.. is not
"elegant"

Here is how my solution works...

I created this file
https://github.com/gkos/personal-awesome-configuration/blob/master/alsactl.lua.
The string_filter on this file is where I concentrate the
"configuration?", I need to make sure that this filter returns me:
- 1th the volume in percentage
- 2nd the mute state, as "on" or "off"
I do this by running amixer and getting the string output, and then
replace the places that change and that I want to get by lua's "kind
of" regexs

Then I put it in my ~/.config/awesome directory..

and on rc.lua I do this http://pastebin.com/ZJ9qReTi
and bind my multimedia keys as in http://pastebin.com/dUeb8NTQ

After that, the only thing that I need to change if things get wrong
os the string_filter.. and things start to work again.. This might
happen if I change alsa or pulseaudio stuff.. that, on other hand,
changes the amixer output.


I urge to people to bring its solutions here so, a better solution can
raise, or not..

Cheers!!!

-- 
*"Do or do not. There is no try"*
*  **Yoda Master*

-- 
To unsubscribe, send mail to [email protected].

Reply via email to