
Hi All, I want to map my vol up and vol down keys. I used xev to capture their info as follows: KeyRelease event, serial 27, synthetic NO, window 0x1600001, root 0x115, subw 0x0, time 1035672, (320,301), root:(321,319), state 0x0, keycode 122 (keysym 0x1008ff11, XF86AudioLowerVolume), same_screen YES, XLookupString gives 0 bytes: XFilterEvent returns: False KeyPress event, serial 27, synthetic NO, window 0x1600001, root 0x115, subw 0x0, time 1036158, (320,301), root:(321,319), state 0x0, keycode 123 (keysym 0x1008ff13, XF86AudioRaiseVolume), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False but I dont know how to use them in my xmonad.hs like other keys: myKeys = \c -> mkKeymap c $ -- volume key binding [ ("M-=", spawn "aumix2pipe +10") , ("M--", spawn "aumix2pipe -10") Could anyone provide a solution? thanks lars

On Sun, Jan 10, 2010 at 12:42 AM, Chengqi Song
I want to map my vol up and vol down keys. I used xev to capture their info as follows:
KeyRelease event, serial 27, synthetic NO, window 0x1600001, root 0x115, subw 0x0, time 1035672, (320,301), root:(321,319), state 0x0, keycode 122 (keysym 0x1008ff11, XF86AudioLowerVolume), same_screen YES, XLookupString gives 0 bytes: XFilterEvent returns: False
[...]
Could anyone provide a solution?
try ((0, 0x1008ff11), spawn ... )

myKeys = \c -> mkKeymap c $ -- volume key binding [ ("M-=", spawn "aumix2pipe +10") , ("M--", spawn "aumix2pipe -10") , ((0, 0x1008ff11), spawn "aumix2pipe -10") ... does not compile. lars On Sun, 10 Jan 2010, Konstantin Sobolev wrote:
On Sun, Jan 10, 2010 at 12:42 AM, Chengqi Song
wrote: I want to map my vol up and vol down keys. I used xev to capture their info as follows:
KeyRelease event, serial 27, synthetic NO, window 0x1600001, ? ?root 0x115, subw 0x0, time 1035672, (320,301), root:(321,319), ? ?state 0x0, keycode 122 (keysym 0x1008ff11, XF86AudioLowerVolume), same_screen YES, ? ?XLookupString gives 0 bytes: ? ?XFilterEvent returns: False
[...]
Could anyone provide a solution?
try ((0, 0x1008ff11), spawn ... )

On Sun, 10 Jan 2010 14:48:07 +0800
Chengqi Song
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

Quoting "Ian D. Leroux"
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-X1... 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

On Sun, 10 Jan 2010 16:19:16 -0500 wagnerdm@seas.upenn.edu wrote:
Quoting "Ian D. Leroux"
: http://hackage.haskell.org/packages/archive/X11/1.5.0.0/doc/html/Graphics-X1... 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") ]
Much better than my version, thanks for pointing that out. Note that this requires a more recent version of the X11 library than currently ships with Debian. -- Ian Leroux

On Sun, Jan 10, 2010 at 7:42 AM, Chengqi Song
Hi All,
I want to map my vol up and vol down keys. I used xev to capture their info as follows:
KeyRelease event, serial 27, synthetic NO, window 0x1600001, root 0x115, subw 0x0, time 1035672, (320,301), root:(321,319), state 0x0, keycode 122 (keysym 0x1008ff11, XF86AudioLowerVolume), same_screen YES, XLookupString gives 0 bytes: XFilterEvent returns: False
KeyPress event, serial 27, synthetic NO, window 0x1600001, root 0x115, subw 0x0, time 1036158, (320,301), root:(321,319), state 0x0, keycode 123 (keysym 0x1008ff13, XF86AudioRaiseVolume), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False
but I dont know how to use them in my xmonad.hs like other keys:
myKeys = \c -> mkKeymap c $ -- volume key binding [ ("M-=", spawn "aumix2pipe +10") , ("M--", spawn "aumix2pipe -10")
Could anyone provide a solution?
It's simple: myKeys = \c -> mkKeymap c $ -- volume key binding [ ("<XF86AudioRaiseVolume>", spawn "aumix2pipe +10") , ("<XF86AudioLowerVolume>", spawn "aumix2pipe -10")]

it works! thanks lars On Sun, 10 Jan 2010, Viktor Deryagin wrote:
On Sun, Jan 10, 2010 at 7:42 AM, Chengqi Song
wrote: Hi All,
I want to map my vol up and vol down keys. I used xev to capture their info as follows:
KeyRelease event, serial 27, synthetic NO, window 0x1600001, root 0x115, subw 0x0, time 1035672, (320,301), root:(321,319), state 0x0, keycode 122 (keysym 0x1008ff11, XF86AudioLowerVolume), same_screen YES, XLookupString gives 0 bytes: XFilterEvent returns: False
KeyPress event, serial 27, synthetic NO, window 0x1600001, root 0x115, subw 0x0, time 1036158, (320,301), root:(321,319), state 0x0, keycode 123 (keysym 0x1008ff13, XF86AudioRaiseVolume), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False
but I dont know how to use them in my xmonad.hs like other keys:
myKeys = \c -> mkKeymap c $ -- volume key binding [ ("M-=", spawn "aumix2pipe +10") , ("M--", spawn "aumix2pipe -10")
Could anyone provide a solution?
It's simple:
myKeys = \c -> mkKeymap c $ -- volume key binding [ ("<XF86AudioRaiseVolume>", spawn "aumix2pipe +10") , ("<XF86AudioLowerVolume>", spawn "aumix2pipe -10")]
participants (5)
-
Chengqi Song
-
Ian D. Leroux
-
Konstantin Sobolev
-
Viktor Deryagin
-
wagnerdm@seas.upenn.edu