You are not logged in.
Not being able to use my keyboard's multimedia keys in Crunchbang has been a real bugbear of mine, so I decided, with some help from becatlibra's post in the CrunchEee support thread, to sort it out myself. This config will only work with Exaile, although I expect that if you change the commands in the rc.xml slightly it should work with other media players as well.
1/ Create a ".Xmodmap" text file in /home/username
This should contain:
keycode 121 = XF86AudioMute
keycode 122 = XF86AudioLowerVolume
keycode 123 = XF86AudioRaiseVolume
keycode 171 = XF86AudioNext
Keycode 172 = XF86AudioPlay
Keycode 173 = XF86AudioPrev
Keycode 174 = XF86AudioStop
Save the file.
2/ sudo gedit ~/.config/openbox/rc.xml
Add the following into the "keyboard" section of the text file (between the lines " </keyboard>" and " </keybind>")
<keybind key="XF86AudioLowerVolume">
<action name="Execute">
<command>amixer sset PCM,0 5%-</command>
</action>
</keybind>
<keybind key="XF86AudioMute">
<action name="Execute">
<command>amixer sset iSpeaker,0 toggle</command>
</action>
</keybind>
<keybind key="XF86AudioNext">
<action name="Execute">
<command>exaile -n</command>
</action>
</keybind>
<keybind key="XF86AudioPlay">
<action name="Execute">
<command>exaile -t</command>
</action>
</keybind>
<keybind key="XF86AudioPrev">
<action name="Execute">
<command>exaile -p</command>
</action>
</keybind>
<keybind key="XF86AudioStop">
<action name="Execute">
<command>exaile -s</command>
</action>
</keybind>Save the file.
3/ Right click on your desktop, navigate through Preferences and Openbox Config to your autostart.sh file. Add this line to it:
xmodmap /home/username/.XmodmapSave the file and restart Openbox.
Hope it works as well for you as it has for me 
Offline
Excellent info, thanks. Where did you get the keycodes from, is there a utility to scan for them?
My volume keys aren working, and I also don get any errors in dmesg, so I have no idea what their keycodes are, or if they are even generating any event.
Also wheres the best place to change keyboard - I can put xetxkbmap in xinitrc or somewhere, but that doesnt seem right - surely setxkbmap is executed per session, or at server startup anyway, and must read a configuration variable from somewhere? I think it used to be in xorg.conf, but not sure that works anymore.
EDIT: Doh. You change keyboard layout in the openbox autostart.sh script too.
Now, to define pound and euro on my US intl keyboard, ideally using right-alt-$ and right-alt3-e ....
Last edited by jackbang (2009-06-19 02:40:25)
Offline
You use xev to get the keycodes. You can find some info about using it in this thread:
Note: ** Please read before posting **
BTW if you wish to contact me, send me an e-mail instead of a PM.
Offline
Thanks, very useful thread. The amixer commands above might need changing for some people, I have
<keybind key="XF86AudioRaiseVolume">
<action name="Execute">
<command>amixer sset Master,0 5%+</command>
</action>
</keybind>
<keybind key="XF86AudioLowerVolume">
<action name="Execute">
<command>amixer sset Master,0 5%-</command>
</action>
</keybind>
<keybind key="XF86AudioMute">
<action name="Execute">
<command>amixer sset Master,0 toggle</command>
</action>
</keybind>Unfortunately the lxpanel volume control doesn't update itself with the current state. oh well, physical buttons are easier anyway.
Offline
Sorry to hijack the thread into general xmodmap discussion.
I just added euro, pound, yen, as right-alt-e, right-alt-#, right-alt-y, on my keyboard.
I had to map the right-alt key to generate Mode_switch instead of ISO_Level3_Shift. I don't know if this will have other bad effects, I don't know what ISO_Level3_Shift is used for.
If I do xmodmap -pke I get lines like
keycode 26 = e E e E e EAFAIK the keysyms are supposed to be in order, "e", "shift e", "Mode-switch e", "Mode_switch + shift e", "ISO_Level3_Shift e", "ISO_Level3_Shift + shift e".
My right-alt key generated ISO_Level3_Shift under xev, so it should just be a case of changing the 5th and or 6th columns to be EuroSign. Unfortunately this just didn't work, so I changed the right-alt key to generate Mode_switch.
.Xmodmap:
keycode 108 = Mode_switch
keycode 26 = e E EuroSign EuroSign
keycode 29 = y Y yen yen
keycode 12 = 3 numbersign sterling sterlingThis seems a hit hackish to me, is there a better way?
Last edited by jackbang (2009-06-19 04:45:19)
Offline
Unfortunately the lxpanel volume control doesn't update itself with the current state. oh well, physical buttons are easier anyway.
No, bit of a shame but I have no idea how to do that! If anyone's got any suggestions that would be awesome 
Offline
Here are the keybindings for MOC, Audacious, Banshee and Exaile. These are aimed at those of us with multimedia led keys on laptops.
Banshee
<keybind key="XF86AudioRaiseVolume">
<action name="Execute">
<command>amixer sset Master,0 3%+</command>
</action>
</keybind>
<keybind key="XF86AudioLowerVolume">
<action name="Execute">
<command>amixer sset Master,0 3%-</command>
</action>
</keybind>
<keybind key="XF86AudioMute">
<action name="Execute">
<command>amixer sset Master,0 toggle</command>
</action>
</keybind>
<keybind key="XF86AudioNext">
<action name="Execute">
<command>banshee --next</command>
</action>
</keybind>
<keybind key="XF86AudioPlay">
<action name="Execute">
<command>banshee --toggle-playing</command>
</action>
</keybind>
<keybind key="XF86AudioPrev">
<action name="Execute">
<command>banshee --previous</command>
</action>
</keybind>
<keybind key="XF86AudioStop">
<action name="Execute">
<command>banshee --stop</command>
</action>
</keybind>
<keybind key="XF86AudioPause">
<action name="Execute">
<command>banshee --toggle-playing</command>
</action>
</keybind>Exaile
<keybind key="XF86AudioRaiseVolume">
<action name="Execute">
<command>amixer sset Master,0 3%+</command>
</action>
</keybind>
<keybind key="XF86AudioLowerVolume">
<action name="Execute">
<command>amixer sset Master,0 3%-</command>
</action>
</keybind>
<keybind key="XF86AudioMute">
<action name="Execute">
<command>amixer sset Master,0 toggle</command>
</action>
</keybind>
<keybind key="XF86AudioNext">
<action name="Execute">
<command>exaile -n</command>
</action>
</keybind>
<keybind key="XF86AudioPlay">
<action name="Execute">
<command>exaile -t</command>
</action>
</keybind>
<keybind key="XF86AudioPrev">
<action name="Execute">
<command>exaile -p</command>
</action>
</keybind>
<keybind key="XF86AudioStop">
<action name="Execute">
<command>exaile -s</command>
</action>
</keybind>
<keybind key="XF86AudioPause">
<action name="Execute">
<command>exaile -t</command>
</action>
</keybind>MOC
<keybind key="XF86AudioRaiseVolume">
<action name="Execute">
<command>amixer sset Master,0 3%+</command>
</action>
</keybind>
<keybind key="XF86AudioLowerVolume">
<action name="Execute">
<command>amixer sset Master,0 3%-</command>
</action>
</keybind>
<keybind key="XF86AudioMute">
<action name="Execute">
<command>amixer sset Master,0 toggle</command>
</action>
</keybind>
<keybind key="XF86AudioNext">
<action name="Execute">
<command>mocp -f</command>
</action>
</keybind>
<keybind key="XF86AudioPlay">
<action name="Execute">
<command>mocp -G</command>
</action>
</keybind>
<keybind key="XF86AudioPrev">
<action name="Execute">
<command>mocp -r</command>
</action>
</keybind>
<keybind key="XF86AudioStop">
<action name="Execute">
<command>mocp --stop</command>
</action>
</keybind>
<keybind key="XF86AudioPause">
<action name="Execute">
<command>mocp -G</command>
</action>
</keybind>Audacious
<keybind key="XF86AudioRaiseVolume">
<action name="Execute">
<command>amixer sset Master,0 3%+</command>
</action>
</keybind>
<keybind key="XF86AudioLowerVolume">
<action name="Execute">
<command>amixer sset Master,0 3%-</command>
</action>
</keybind>
<keybind key="XF86AudioMute">
<action name="Execute">
<command>amixer sset Master,0 toggle</command>
</action>
</keybind>
<keybind key="XF86AudioNext">
<action name="Execute">
<command>audacious -f</command>
</action>
</keybind>
<keybind key="XF86AudioPlay">
<action name="Execute">
<command>audacious -p</command>
</action>
</keybind>
<keybind key="XF86AudioPrev">
<action name="Execute">
<command>audacious -r</command>
</action>
</keybind>
<keybind key="XF86AudioStop">
<action name="Execute">
<command>audacious -s</command>
</action>
</keybind>
<keybind key="XF86AudioPause">
<action name="Execute">
<command>audacious -t</command>
</action>
</keybind>Last edited by jinnstar (2009-08-23 15:31:14)
Offline
I can confirm that multimedia led keys also work with Sonata, with adding keybinding in rc.xml.
<keybind key="XF86AudioLowerVolume">
<action name="Execute">
<execute>amixer -c 0 set Master 5%- unmute</execute>
</action>
</keybind>
<keybind key="XF86AudioRaiseVolume">
<action name="Execute">
<execute>amixer -c 0 set Master 5%+ unmute</execute>
</action>
</keybind>
<keybind key="XF86AudioMute">
<action name="Execute">
<execute>amixer -c 0 set Master mute</execute>
</action>
<action name="Execute">
<execute>amixer -c 0 set Master unmute</execute>
</action>
</keybind>Offline
easiest solution i've found for this is to use xbindkeys and the gui editor xbindkeys-config, which makes managing custom keys a breeze.
Hell, there are no rules here - we're trying to accomplish something. - T. A. Edison
http://www.grendelchen.com/ | brummbaer456 at gmail dot com
Offline
easiest solution i've found for this is to use xbindkeys and the gui editor xbindkeys-config, which makes managing custom keys a breeze.
For some reason the XML doesn't seem to process the XF86 signals for me; I can't get any XF86 key to send commands to the command line. However, xbindkeys works, though the GUI is kinda ugly. Not that looks count with such easy functionality.
For now I'm stuck with a laggy command "volwheel -*" but now I can zap those damn ads on Hulu every time they jump up with their extra loud volume!
Offline
I can confirm that multimedia led keys also work with Sonata, with adding keybinding in rc.xml.
Excellent. Thanks a bunch.
I just changed "Master" to "PCM" as amixer don't recognise master in my system. Also - some people like to unmute the sound when the change the volume. If so one can just add the "unmute" command, like so.
amixer sset PCM,0 3%+ unmuteAgain - thanks a lot!
Offline
Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.