[xmonad] how to map XF86* keys?

wagnerdm at seas.upenn.edu wagnerdm at seas.upenn.edu
Sun Jan 10 16:19:16 EST 2010


Quoting "Ian D. Leroux" <idleroux at fastmail.fm>:

> myKeys XConfig{XMonad.modMask = modm} = M.fromList
>     [ ...
>       -- XF86AudioMute
>     , ((0, 0x1008ff12), spawn "amixer -q set PCM toggle")
>       -- XF86AudioRaiseVolume
>     , ((0, 0x1008ff13), spawn "amixer -q set PCM 1+")
>       -- XF86AudioLowerVolume
>     , ((0, 0x1008ff11), spawn "amixer -q set PCM 1-")
>       -- XF86Mail
>     , ((0, 0x1008ff19), spawn "urxvtc -e abook")
>     ]

To anyone using this trick, the X11 library has names for these.   
Please use them!

http://hackage.haskell.org/packages/archive/X11/1.5.0.0/doc/html/Graphics-X11-ExtraTypes-XF86.html

For example:

import Graphics.X11.ExtraTypes.XF86

myKeys XConfig{XMonad.modMask = modm} = M.fromList
     [ ...
     , ((0, xF86XK_AudioMute, spawn "amixer -q set PCM toggle")
     , ((0, xF86XK_AudioRaiseVolume, spawn "amixer -q set PCM 1+")
     , ((0, xF86XK_AudioLowerVolume, spawn "amixer -q set PCM 1-")
     , ((0, xF86XK_Mail, spawn "urxvtc -e abook")
     ]

Also, I feel compelled to take this chance to suggest  
XMonad.Actions.Volume; more info here:
http://www.dmwit.com/volume

Cheers!
~d


More information about the xmonad mailing list