You are not logged in.

#1 2009-02-06 19:29:01

Redrazor39
Member
Registered: 2008-12-23
Posts: 108

Xmonad.hs multimedia keys: What do some of the things mean?

I would like to set Fn + F2 to mute, Fn + F3 to volume down, Fn + F4 to volume up in xmonad (preferably with xmonad.hs).

I do have sound working, but no way to adjust it via keyboard (which I would like to do).

After some googling, I found something that looks like it would work, but I don't completely understand it and don't know where else to look for help. Here is what someone added to their xmonad.hs file after the keybindings part:

   -- multimedia keys
   --
   -- XF86AudioLowerVolume
   , ((0            , 0x1008ff11), spawn "aumix -v -2")
   -- XF86AudioRaiseVolume
   , ((0            , 0x1008ff13), spawn "aumix -v +2")
   -- XF86AudioMute
   , ((0            , 0x1008ff12), spawn "amixer -q set PCM toggle")

The confusing part for me is the stuff like "((0            , 0x1008ff12)", which I don't understand in the slightest. Could someone please explain this to me or adjust it to mean the keybindings in the beginning of this post I want?

Also, the last part (muting) says "amixer -q set PCM toggle", when my volume is set by the Master one. Would I just have to change "PCM" to "Master" to fix that?

Thanks for any help. If it helps, here are some of my keycodes I got from xev:

Mute = keycode 160
Volume Down = keycode 174
Volume Up = keycode 176

Offline

#2 2009-02-06 20:28:43

Redrazor39
Member
Registered: 2008-12-23
Posts: 108

Re: Xmonad.hs multimedia keys: What do some of the things mean?

*sigh*. Is there any way I could have this moved to a more relevant section where I may get more help with this? Perhaps Desktop Environments or Laptops? Wherever there are more xmonad users.

(And also delete this post please)

Offline

#3 2009-02-06 20:54:56

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: Xmonad.hs multimedia keys: What do some of the things mean?

Redrazor39 wrote:

*sigh*. Is there any way I could have this moved to a more relevant section where I may get more help with this? Perhaps Desktop Environments or Laptops? Wherever there are more xmonad users.

(And also delete this post please)

Its been an hour since you posted the thread.. Be patient, not every user is online 24/7. someone who uses xmonad is sure to come by and help you out.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#4 2009-02-07 06:37:12

dusanx
Member
Registered: 2008-11-28
Posts: 132

Re: Xmonad.hs multimedia keys: What do some of the things mean?

You can look for codes in /usr/share/X11/XKeysymDB. Xmonad does not have key names or I could not find them so I use something like this:

    -- XF86AudioMute
    , ((0 , 0x1008ff12), spawn "amixer -q set PCM toggle")
    -- XF86AudioLowerVolume
    , ((0 , 0x1008ff11), spawn "amixer -q set PCM 1- unmute")
    -- XF86AudioRaiseVolume
    , ((0 , 0x1008ff13), spawn "amixer -q set PCM 1+ unmute")
    --XF86Launch1 :1008FF41
    , ((0 , 0x1008FF41), windows $ W.greedyView "1")
    --XF86Launch2 :1008FF42
    , ((0 , 0x1008FF42), windows $ W.greedyView "2")
    --XF86Launch3 :1008FF43
    , ((0 , 0x1008FF43), windows $ W.greedyView "3")
    --XF86Launch4 :1008FF44
    , ((0 , 0x1008FF44), windows $ W.greedyView "4")
    --XF86Launch5 :1008FF45
    , ((0 , 0x1008FF45), windows $ W.greedyView "5")
    --XF86Launch6 :1008FF46
    , ((0 , 0x1008FF46), windows $ W.greedyView "6")

I am using G1-G6 keys on Logitech G15 keyboard as fast switch for workspaces 1-6.

Edit:
For other, more usual keycodes look here: http://www.haskell.org/haskellwiki/Xmonad/Key_codes
You will find F keys there.

Last edited by dusanx (2009-02-07 06:49:11)


Gnome -> Openbox -> Awesome -> XMonad -> dwm .
http://github.com/dusanx/uzbl/

Offline

#5 2009-02-07 11:18:05

andre.ramaciotti
Member
From: Brazil
Registered: 2007-04-06
Posts: 649

Re: Xmonad.hs multimedia keys: What do some of the things mean?

Notice, however, that you must suply the name/code of the keysym. Unfortunatelly, there is no way to simply put the keycode that I'm aware of.


(lambda ())

Offline

#6 2009-02-07 15:56:23

Redrazor39
Member
Registered: 2008-12-23
Posts: 108

Re: Xmonad.hs multimedia keys: What do some of the things mean?

Thank you. I'll just try keytouch or something. Perhaps I've been doing something wrong (missing a step maybe?), so I'll just follow the wiki this time.

Offline

#7 2009-03-10 10:59:01

listdata
Member
Registered: 2008-12-23
Posts: 102
Website

Re: Xmonad.hs multimedia keys: What do some of the things mean?

dusanx wrote:

You can look for codes in /usr/share/X11/XKeysymDB. Xmonad does not have key names or I could not find them so I use something like this:

    -- XF86AudioMute
    , ((0 , 0x1008ff12), spawn "amixer -q set PCM toggle")
    -- XF86AudioLowerVolume
    , ((0 , 0x1008ff11), spawn "amixer -q set PCM 1- unmute")
    -- XF86AudioRaiseVolume
    , ((0 , 0x1008ff13), spawn "amixer -q set PCM 1+ unmute")
    --XF86Launch1 :1008FF41
    , ((0 , 0x1008FF41), windows $ W.greedyView "1")
    --XF86Launch2 :1008FF42
    , ((0 , 0x1008FF42), windows $ W.greedyView "2")
    --XF86Launch3 :1008FF43
    , ((0 , 0x1008FF43), windows $ W.greedyView "3")
    --XF86Launch4 :1008FF44
    , ((0 , 0x1008FF44), windows $ W.greedyView "4")
    --XF86Launch5 :1008FF45
    , ((0 , 0x1008FF45), windows $ W.greedyView "5")
    --XF86Launch6 :1008FF46
    , ((0 , 0x1008FF46), windows $ W.greedyView "6")

I am using G1-G6 keys on Logitech G15 keyboard as fast switch for workspaces 1-6.

Edit:
For other, more usual keycodes look here: http://www.haskell.org/haskellwiki/Xmonad/Key_codes
You will find F keys there.

Wow, thanks! These hotkeys work just fine for me (I only had to change "PCM" to "Master"), on my Dell Latitude D505. No need for Keytouch! (I didn't bother with your workspace switching hotkeys because... I don't have them on my laptop's keyboard. wink)

FYI: Your single xmonad.hs file solution did not work for me until I got rid of some xmodmap commands in my .xinitrc file where I had previously mapped my function volume keys to XF86AudioMute, XF86AudioRaiseVolume, and XF86AudioLowerVolume. (I had used xmodmap like so: http://www.linuxforums.org/forum/misc/6 … #post36696 in an attempt to get them to work before stumbling across this thread.) It seems like once these keys were mapped to their XF86 equivalents, the X window system would interpret these hotkeys, which would result in a conflict with XMonad's own hotkeys as in your config file above. So the moral of the lesson is: let XMonad do everything by itself!

Last edited by listdata (2009-03-10 11:00:15)

Offline

#8 2009-03-10 23:46:04

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: Xmonad.hs multimedia keys: What do some of the things mean?

Or perhaps you could relieve yourself of all this hassle and just use xbindkeys!
It's great because you get to configure them once and they're WM independent.


The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...

Offline

Board footer

Powered by FluxBB