Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Other Community Discussions > Tutorials & Tips
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Tutorials & Tips
The place to find Ubuntu related Tips & Tricks.

 
Thread Tools Display Modes
Old October 20th, 2005   #1
frodon
Ubuntu French Roast
 
frodon's Avatar
 
Join Date: Jun 2005
Location: France
Beans: 6,385
Ubuntu 9.10 Karmic Koala
HOWTO : Create a custom keyboard shortcut

The goal of this small HOWTO is to create a custom keyboard shortcut to run a software (like xmms, 3ddesk, ...) or what command line you want (xkill, transset 0.5, ...). Personally i use this trick to launch xkill, different values of transset and also alltray.

A- Using xbindkeys, works for each desktop (KDE, GNOME, XFCE, ...)

1- First install xbindkeys :
Code:
sudo apt-get install xbindkeys
2- Install xbindkeys-config, it's a GTK frontend for xbindkeys so it' easy to configure xbindkeys with that.
Code:
sudo apt-get install xbindkeys-config
3- Configuration
Launch xbindkeys :
Code:
xbindkeys
Then launch the GUI :
Code:
xbindkeys-config
And then enjoy how it's easy to configure shortcuts with this GUI



B- Using metacity (the default GNOME window manager)
In the example i give, i want to start xkill (graphical kill) using "Alt + a" shortcut.
You will see some screenshots from aysiu at the bottom of the post.


1- Open GConf editor (Applications -> System Tools -> Configuration Editor), go to apps -> metacity -> keybinding_commands, and now choose a command, for my example I choose command_1. Edit command_1 writing xkill in order to run xkill (or every command you want to launch like in a terminal).

2- In the same directory go to global_keybindings. Edit command_1 (or the command you choose in part 1) with the wanted shortcut like that : <Alt>a (to use the windows key just edit the field with Super_L)


Misc
If you are looking for the name a key, the tool xev will help you. Just type xev in a terminal then you will see an output for each key you hit.
There are some output exemples of xev in this thread.

that's all !

Enjoy
Attached Images
File Type: jpeg Screenshot.jpeg (3.6 KB, 6431 views)
File Type: jpeg Screenshot-Configuration Editor - global_keybindings.jpeg (1.6 KB, 6389 views)
File Type: jpeg Screenshot-Configuration Editor - keybinding_commands.jpeg (1.9 KB, 6271 views)
Attached Files
File Type: gz xbindkeys_config-0.1.3.tar.gz (17.2 KB, 229 views)

Last edited by frodon; December 16th, 2005 at 08:15 AM.. Reason: Add xbindkeys guide !!
frodon is online now   Reply With Quote
Old October 27th, 2005   #2
Mustard
Chocolate Ubuntu Mocha Blend
 
Mustard's Avatar
 
Join Date: Jun 2005
Location: Australia
Beans: 1,777
Ubuntu 9.10 Karmic Koala
Re: HOWTO : Create a custom keyboard shortcut

I like this one.
Mustard is offline   Reply With Quote
Old October 28th, 2005   #3
No6
Just Give Me the Beans!
 
No6's Avatar
 
Join Date: Jul 2005
Location: Freckleton, UK
Beans: 31
Kubuntu 6.10 Edgy
Re: HOWTO : Create a custom keyboard shortcut

Great!

I've been using xbindkeys... Ah well you learn something new everyday.
No6 is offline   Reply With Quote
Old October 28th, 2005   #4
bionnaki
Dark Roasted Ubuntu
 
Join Date: Aug 2005
Beans: 1,028
Re: HOWTO : Create a custom keyboard shortcut

anyway to make a keyboard shortcut that'll show hidden files in nautilus? I'd like to change from control-H to something easier...
bionnaki is offline   Reply With Quote
Old October 31st, 2005   #5
Gandalf
Has an Ubuntu Drip
 
Gandalf's Avatar
 
Join Date: Apr 2005
Beans: 688
Dapper Drake Testing/
Re: HOWTO : Create a custom keyboard shortcut

Great TIP Thx,
I would like to add that i've added another shortcut <Alt>z to killall xkill in case you changed your mind and want to quit xkill without killing something..
and i have a question, on my laptop Fn + F6 suppose to lock my screen ( lock PC) but it does eject the DVD-ROM, anyone knows how to change this?

Thanks
__________________
[My Blog] | [My Sites] | [My Ubuntu Guides]

doc.gwos.org, the real successor of Ubuntu Guide
Gandalf is offline   Reply With Quote
Old November 1st, 2005   #6
frodon
Ubuntu French Roast
 
frodon's Avatar
 
Join Date: Jun 2005
Location: France
Beans: 6,385
Ubuntu 9.10 Karmic Koala
Re: HOWTO : Create a custom keyboard shortcut

You can manage that in System > Preferences > keyboard shortcut in the desktop section. There is an eject field and a lock screen field to specify keyboard shortcuts.

Happy to know that you like this small TIP
frodon is online now   Reply With Quote
Old November 28th, 2005   #7
Chris Tucker
Gee! These Aren't Roasted!
 
Chris Tucker's Avatar
 
Join Date: Oct 2005
Location: Swift Current, Newfoundland, Canada
Beans: 205
Kubuntu 6.06
Re: HOWTO : Create a custom keyboard shortcut

how do you add key codes? like my custom volume up is command 'volmute increase' and button code is 0xb0 ..
Chris Tucker is offline   Reply With Quote
Old November 28th, 2005   #8
Chris Tucker
Gee! These Aren't Roasted!
 
Chris Tucker's Avatar
 
Join Date: Oct 2005
Location: Swift Current, Newfoundland, Canada
Beans: 205
Kubuntu 6.06
Re: HOWTO : Create a custom keyboard shortcut

nevermind, used another tutorial to add XF86 syms to my keys
Chris Tucker is offline   Reply With Quote
Old November 28th, 2005   #9
frodon
Ubuntu French Roast
 
frodon's Avatar
 
Join Date: Jun 2005
Location: France
Beans: 6,385
Ubuntu 9.10 Karmic Koala
Re: HOWTO : Create a custom keyboard shortcut

nice !

May you put the link here for other users ?

Thanks
__________________
| Quake Wars fan inside | Ubuntu Backports |
frodon is online now   Reply With Quote
Old November 29th, 2005   #10
Chris Tucker
Gee! These Aren't Roasted!
 
Chris Tucker's Avatar
 
Join Date: Oct 2005
Location: Swift Current, Newfoundland, Canada
Beans: 205
Kubuntu 6.06
Re: HOWTO : Create a custom keyboard shortcut

http://www.djlosch.com/tutorial_debi...cm_volume_link
http://ubuntuforums.org/showthread.p...city+key+codes
used those two to fix my problem where volume keys controlled Master (which affected nothing) to change to control PCM.
Chris Tucker is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:09 PM.


vBulletin ©2000 - 2010, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. lingonberry