[xmonad] Volume Keys

Marco Guidetti marco at marcoguidetti.org
Fri Nov 18 12:01:24 CET 2011

Hi all,

thank you for all the feedback about the xmobar stuff: I have resolved
in using an external script which manages both xmobar instances,
except for the one that is with spawnPipe. It works and seems

Now, there is something more I'd like to fix. I have a Lenovo X220,
and I am trying to use the mute/volume buttons.
I have read something online about using this:

((0, XF86AudioLowerVolume), spawn "amixer -c 0 set Master 2dB-")
((0, XF86AudioRaiseVolume), spawn "amixer -c 0 set Master 2dB+")

[in this case xmonad --recompile returns something along the line of
"there is no XF86AudioRaiseVolume in current context"]

or like this:
 ((0, 0x1008FF11), spawn "amixer -c 0 set Master 2dB-")
 ((0, 0x1008FF13), spawn "amixer -c 0 set Master 2dB+")

[in this case a recompile succeeds, but nothing changes: probably the
0x is wrong?]

but neither of them is not working.

I tried to use xev to get the keycode of the volume buttons, but xev
does not react at all when I press them.
This *really* puzzles me, since they do work if I use my old gnome-based setup.

So ....  ideas? :)

Thank you very much,


I realize a simple solution is to bind the spawn "amixer ..." stuff to
something else on the keyboard, but it doesn't seem right :)

More information about the xmonad mailing list