You are not logged in.

#1 2010-03-30 00:11:03

z.s.tar.gz
Member
From: Rural Florida
Registered: 2008-12-12
Posts: 298

Multimedia keys controlling alsa volume

I have three keys on my keyboard: mute, volume up, and volume down. I would like to be able to manually control the master volume level of alsa for a system-wide volume solution.
Can this be done? If so could someone point me in the right direction? I'm using wmii although I doubt that has little relevancy.


I need to find a way out so everyone can find their way out.
Resregietd Lunix Uesr: 485581

Offline

#2 2010-03-30 00:14:35

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: Multimedia keys controlling alsa volume

most bind the XFX86Media* keys to a script using xbindkeys or your wm configuration.  search the bbs for 'dvol' as it's a nice example on how to do it with alsa.  i have a "fork" of it for oss.

you can check with xev that your multimedia keys generate the correct the XF86* keysyms.

/edited for clarity.

Last edited by brisbin33 (2010-03-30 00:23:33)

Offline

#3 2010-03-30 01:12:57

z.s.tar.gz
Member
From: Rural Florida
Registered: 2008-12-12
Posts: 298

Re: Multimedia keys controlling alsa volume

oh yeah I forgot to mention that they work, it's just a matter of what to do with em.
thanks I'll look into it right away!


I need to find a way out so everyone can find their way out.
Resregietd Lunix Uesr: 485581

Offline

#4 2010-04-01 13:22:55

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: Multimedia keys controlling alsa volume

I use xbindkeys, e.g. in ~/.xbindkeysrc

"/usr/bin/amixer -q sset Master 2+"
    Control+Shift + Up
"/usr/bin/amixer -q sset Master 2-"
    Control+Shift + Down

Offline

#5 2010-04-01 15:11:17

Hohoho
Member
Registered: 2007-06-23
Posts: 222

Re: Multimedia keys controlling alsa volume

I use esekeyd for this. With it you get completely global hotkeys that work anywhere, even in fullscreen games.
I have this in my esekeyd.conf:

VOLUMEDOWN:amixer set Master 5%- &
VOLUMEUP:amixer set Master 5%+ &
MUTE:amixer set Master toggle &

Last edited by Hohoho (2010-04-01 15:12:06)

Offline

#6 2010-04-01 18:21:13

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: Multimedia keys controlling alsa volume

Hohoho wrote:

even in fullscreen games

Yeah, that's a good feature. Now I'm using *both* esekeyd (to work in fullscreen games) and xbindkeys (for multiple-key combinations) smile

Offline

#7 2010-09-09 00:10:19

berot3
Member
From: Vienna
Registered: 2009-12-12
Posts: 21

Re: Multimedia keys controlling alsa volume

brebs wrote:
Hohoho wrote:

even in fullscreen games

Yeah, that's a good feature. Now I'm using *both* esekeyd (to work in fullscreen games) and xbindkeys (for multiple-key combinations) smile

thats EXCACTLY what im searching for, the last few weeks (or even months), i want to play next track on amarok or pause or wahtever!
i hope some1 is stil lreadin this ^^

like u guys already discovered: i play ut2004 and ofc no hotkey works and ofc also not with xbindkeys
i got it working with esekeyd so thats what i have in my /etc/esekeyd.conf:

INSERT:su -l berot3 -c "/bin/bash -l -c 'DISPLAY=:0 amarok -t &'"

i never use INSERT thats why i use that key. and amarok rly does what it should: toggle play/pause

BUT esekeyd ONLY gets ONE key... that sux cause every1 is used to have more tahn 1...
i know that xbinkeys can do that but HOW did u combine *both* so taht i can control amarok with for example "Fn + BKey DOWN" ( learnkeys dowsnt recognize my Fn-keys, on my laptop)???
nvm, got fixed in newer version, except the FN-thing, but not so important smile

Last edited by berot3 (2010-09-17 19:33:34)

Offline

Board footer

Powered by FluxBB