You are not logged in.
Hi all, didn't found that tutorial so even if i am not that much experienced, here's a quick tutorial
In order to make a shortcut, or configure a special key (Fn + F5, or any key S1, S2 on my VAIO for exemple) you have to go into your rc.xml and cant be done with Obconf.
You have to edit it by yourself, but it's not complicated :
Keyboard shortcuts
With Openbox, you can easy create a shortcut to lauch a program, open a menu or change from a desktop to another. You just have to go to the "keyboard" section of your rc.xml
Here's some exemples :
1. To launch a program or a command (here Nautilus) :
<keybind key="A-F4">
<action name=”Execute”>
<execute>nautilus --no-desktop</execute>
</action>
</keybind>2. To launch a menu, here the main menu
<keybind key="A-F1">
<action name=”ShowMenu”>
<menu>root-menu</menu>
</action>
</keybind>3. To change desktop:
<keybind key="A-1">
<action name=”Desktop”>
<desktop>1</desktop>
</action>
</keybind>A = alt, C = control, W = Windows key (super). Escape = echap, Delete = Suppr.
You can also use any particular button ( fn style, multimedia button for laptop), but you need to know their name.
So you can use xev to find that
You just have to type xev into a terminal (validate with enter), then press the button you want to use
Lot of infos will shown but what's interest us is what is writing after “keycode”
Now you can use it !
More informations on the Openbox information site.
Any commentary or proposition to improve it will be appreciated
Last edited by Bast (2009-01-29 18:34:15)
"democracy has to be more than two wolves and a sheep voting on what to have for dinner"
Offline
Hello Bast 
Thank you for writing this, I am sure lots of people will find it useful! Nice one.
Offline
Very helpful indeed!
Thank you!
Reality is just a bunch of illusion...
Zaxxon @ Übergeek Blog | twitter | last.fm | VampireFreaks
Offline
You're welcome, thanks 
"democracy has to be more than two wolves and a sheep voting on what to have for dinner"
Offline
You can also use any particular button ( fn style, multimedia button for laptop), but you need to know their name.
So you can use xev to find that
You just have to type xev into a terminal (validate with enter), then press the button you want to use
Lot of infos will shown but what's interest us is what is writing after “keycode”
Now you can use it !
Thanks for the info. Didn't know how to make use of the function key with openbox, so this is very helpful. 
Offline
of note: the command-line way to set volume is the 'amixer' command, if you want to link that to keys
ex:
amixer -c 0 set PCM 2dB-Will decrease PCM volume by 2 decibels
amixer -c 0 set PCM 2dB+Will increase PCM volume by 2 decibels
amixer -c 0 set PCM muteWill mute PCM volume
The box said 'Requires Windows 2000 or better, so I installed Linux'
(No, I didn't make that, but it holds true, so I use it in my sig)
Offline
Thanks for posting this, I am sure this is one of the things that many people struggle to figure out.
I would like to add that "XFree86" keys can also be used. For example Fn+UpArrow on my Aspire One is "XF86AudioRaiseVolume".
It is also worth noting that
amixer -c 0 PCM togglewill toggle the sound on or off rather than just mute and not unmute it.
I also prefer to change the volume of "Master" rather than "PCM" with my hotkeys.
Putting this all together gives me something like:
<keybind key="XF86AudioMute">
<action name="Execute">
<execute>amixer -c 0 set Master toggle</execute>
</action>
</keybind>
Thanks
Offline
Hey -
I have followed along with the format Bassetts showed, and it worked perfectly for my mute & volume buttons on the Dell XPS. However, only the PCM option seems to control all the volume levels, since it has 2 speakers on one circuit and a subwoofer on a seperate one, and the Master toggle does *nothing* to either, and some of the others only modify one or the other.
Thankfully, PCM works perfectly for all. You might have to play with your options to find what works. Thanks so much for the guide!
Ryan
Offline
for what it is worth (i'm rather inexpert),
this is how i've edit my rc.xml
<!-- Keybindings for Master Volume -->
<!-- F7 [un]mute -->
<keybind key="F7">
<action name="Execute">
<execute>amixer -c 0 set Master toggle</execute>
</action>
</keybind>
<!-- F8 2db-decrease -->
<keybind key="F8">
<action name="Execute">
<execute>amixer -c 0 set Master 2dB-</execute>
</action>
</keybind>
<!-- F9 2db-increase -->
<keybind key="F9">
<action name="Execute">
<execute>amixer -c 0 set Master 2dB+</execute>
</action>
</keybind>
of course after editing rc.xml save it &
preferences>>openbox config>>restart
[btw what's the difference between restarting & reconfiguring rc.xml?]
better to unmute before de/in-crease
<!-- F8 2db-decrease -->
<keybind key="F8">
<action name="Execute">
<execute>amixer -c 0 set Master unmute</execute>
</action>
<action name="Execute">
<execute>amixer -c 0 set Master 2dB-</execute>
</action>
</keybind>
<!-- F9 2db-increase -->
<keybind key="F9">
<action name="Execute">
<execute>amixer -c 0 set Master unmute</execute>
</action>
<action name="Execute">
<execute>amixer -c 0 set Master 2dB+</execute>
</action>
</keybind>
Last edited by gnema (2009-01-31 09:51:51)
Offline
Thanks for kinds words and also for your helpful posts.
Last edited by Bast (2009-01-30 13:57:40)
"democracy has to be more than two wolves and a sheep voting on what to have for dinner"
Offline
Thanks for all the info!
so why does fn + brightness up/down work out of the box but not volume? Any chance of getting the volume graphics showing up (like when I turn brightness up or down)?
Offline
I would love to see some volume/brightness graphics when I change the volume and brightness. Following your steps here I was able to get my fn+left/right working for my volume but (and in no distro does it currently work) the brightness keys do not work (there is a kernel patch but no module yet so im waiting)
I would like to map the brightness keys to Ctrl + Up/Down instead. or if you want to check out the kernel patch and see how hard that would be to implement the link is here :
http://bugzilla.kernel.org/attachment.cgi?id=19301
Im not sure what command to execute to up the brightness by 5% or 10%.
Any ideas?
Xisdibik
-edit: I am using the Samsung NC10 Netbook incase you were wondering.
Last edited by Xisdibik (2009-01-31 12:04:17)
Offline
Hi !
First of all, great distribution! 
I'm also using a Samsung NC10 and it is true that it would be great to be able to set the brightness of our screen!
Can we use xbacklight without gnome like for Ubuntu?
Also, is there an applet which allow us to set different frequencies for processors?
PS: sorry for my english
Offline
My Brightness Worked out of the box, as did the volume.
The only one I had issues with was that if I used the mute one, it doesn't turn off mute when I hit it again. It's only acting as "Mute on" not "switch mute on/off" meaning I need to hit Super+v and bring the volume back up manually (if it's muted, the vol up/down keys don't work either)
Ex-KDE user.
Collects old PC's (Coz he can't afford new ones =P)
Crunchbang @ Distrowatch
My Blog (updated infrequently, and on the #! Planet too.)
Offline
Hi guys. Wiki page added:
http://crunchbanglinux.org/wiki/howto/e … _shortcuts
Can we please have this added to "howto section", or whatever the approrpriate page would be?
I will add trackback links to this forum post.
-- fields
--
e.m.fields
chapel hill, nc
Offline
Great tutorial, very helpful. Thank you.
But how do I create a w- (super key alone) shortcut to iconify (or minimize) all windows when I don't know the action name for it?
Offline
Never mind, I found out myself. Pressing Super + D iconifies all windows.
Offline
xev doesn't detect my Fn key, although brightness and sleep shortcuts worked out of the box.
Sony VAIO VGN-N130G
-1.6-GHz Intel Core Duo, Intel GMA 950/128MB, 1 GB RAM, 80 GB HDD
Offline
Hi !
First of all, great distribution!
I'm also using a Samsung NC10 and it is true that it would be great to be able to set the brightness of our screen!
Can we use xbacklight without gnome like for Ubuntu?
Also, is there an applet which allow us to set different frequencies for processors?PS: sorry for my english
Biniou: Don't worry, the xbacklight workaround works perfectly. You may want to enter the BIOS settings and change the screen brightness from Auto to User Controlled as well, otherwise it tops out at still pretty dark.
I'm trying to throw together all the NC10 specific changes in this thread: http://crunchbanglinux.org/forums/topic … sung-nc10/, so if you have anything to add, please do!
Last edited by munkymack (2009-03-25 21:15:09)
"ACME: We add rockets to everything!"
Crunchbang 8.10 / Windows XP (when I have to) | Samsung NC10 w/ 2gb RAM | www.groundcontrolmag.com / www.spilltheblood.net
Offline
I have a Dell XPS m1530. When I press the volume up button, xev gives me this:
keycode 123 (keysym 0x1008ff13, XF86AudioRaiseVolume)I dont know which of the three to choose.
Also, is there a specific place I put it in my rc.xml? (I put it in at the end of the keyboard section.)
I used this code:
<keybind key="XF86AudioRaiseVolume">
<action name="execute">
<execute>amixer -c 0 set Master 2dB+</execute>
</action>
</keybind>Its ok to use Master, right?
Offline
Just want to say that you guys are lifesavers! I searched far and wide (from the comfort of my laptop
) trying to figure out how to set the key bindings for the volume on my latop. Below is what I entered into my rc.xml (pasting it so it might be of use to others). And btw, "gnema" ... genius idea of the volume keys breaking mute! thanks again for a great post and much much love to the Linux Community!
Here's what I have (you'll notice I just swapped gnema's F8 for my XF86AudioLowerVolume).
<!-- Keybindings for Master Volume -->
<!-- XF86AudioMute [un]mute -->
<keybind key="XF86AudioMute">
<action name="Execute">
<execute>amixer -c 0 set Master toggle</execute>
</action>
</keybind>
<!-- XF86AudioLowerVolume 2db-decrease -->
<keybind key="XF86AudioLowerVolume">
<action name="Execute">
<execute>amixer -c 0 set Master unmute</execute>
</action>
<action name="Execute">
<execute>amixer -c 0 set Master 2dB-</execute>
</action>
</keybind>
<!-- XF86AudioRaiseVolume 2db-increase -->
<keybind key="XF86AudioRaiseVolume">
<action name="Execute">
<execute>amixer -c 0 set Master unmute</execute>
</action>
<action name="Execute">
<execute>amixer -c 0 set Master 2dB+</execute>
</action>
</keybind>
(note: I pasted it in just before the end of the keybinds and before the mousebinds)
Offline
and jc i was wondering about the iconify windows too, thanks also for the super+D tip!
good luck!
Offline
I have a Dell XPS m1530. When I press the volume up button, xev gives me this:
keycode 123 (keysym 0x1008ff13, XF86AudioRaiseVolume)I dont know which of the three to choose.
Also, is there a specific place I put it in my rc.xml? (I put it in at the end of the keyboard section.)
I used this code:
<keybind key="XF86AudioRaiseVolume"> <action name="execute"> <execute>amixer -c 0 set Master 2dB+</execute> </action> </keybind>Its ok to use Master, right?
im wondering this too, would it be 0x1008ff13 or 123
Offline
^ I would just use the "XF86AudioRaiseVolume".
Note: ** Please read before posting **
BTW if you wish to contact me, send me an e-mail instead of a PM.
Offline
em.... uberbdon and opothehippo... if you just read exactly what i pasted in the post before uberbdon's post, and copy what i pasted into the same place where i said i put it, it will work for you. if you notice, we are using the same key labels 
good luck with it
Offline
Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.