[xmonad] how to map XF86* keys?

Ian D. Leroux idleroux at fastmail.fm
Sun Jan 10 08:18:32 EST 2010


On Sun, 10 Jan 2010 14:48:07 +0800
Chengqi Song <songcq at gmail.com> wrote:

> myKeys = \c -> mkKeymap c $
>     -- volume key binding
>     [ ("M-=", spawn "aumix2pipe +10")
>     , ("M--", spawn "aumix2pipe -10")
>     , ((0, 0x1008ff11), spawn "aumix2pipe -10")
>     ...
> 
> does not compile.

It looks like you're using EZConfig, in which case you should be able
to just use
("XF86AudioRaiseVolume", spawn "aumix2pipe -10")
Have a look at the source for "multimediaKeys" in module
XMonad.Util.EZConfig for the names of other multimedia keys.

Those of us who don't use EZConfig can do:

main = xmonad defaultConfig
        { ...
        , keys = \c -> myKeys c `M.union` keys defaultConfig c
        ...
        }

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")
    ]

As was just suggested

Ian Leroux


More information about the xmonad mailing list