Nov 20, 2009

Hotkeys / Keyboard Quick Launch Keys In Linux

free web hosting
Open Discussion & Free Web Hosting > Computers & Tech > How-To's and Tutorials > OS > Linux

Hotkeys / Keyboard Quick Launch Keys In Linux

intrepid
I first submitted this tutorial a couple of months ago over at http://linuxiso.org/forums as user adpsimpson.

Having spent ages wishing the hotkeys on my laptop would work, I spent most of an afternoon looking into it. Since no site I found explained it satisfactorily, here's my method...

The first step is to find out which of the keys are registered by the kernel, and what their keycodes are (the unique event number that they cause). To do this you need a program called xev, (in Mandrake this is part of X11R6-contrib, is installed by default in Slack, and should be easy to find for other distros). From the terminal, in a graphical interface, type xev to launch it, move the mouse over the new window and press the hotkeys. What appears in the terminal is something like
CODE
KeyPress event, serial 28, synthetic NO, window 0x2c00001,
   root 0xb5, subw 0x2c00002, time 3593153, (55,38), root:(730,82),
   state 0x0, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
   XLookupString gives 0 bytes:  ""



The "keycode" (in this case 64) is the important part. The next is to make the keycode actually do something when X registers it. For this you need to run xmodmap to modify the keyboard map. A small script in the ~/.kde/Autostart folder (or similar for other desktops) means this will be done each time KDE is stated. I wanted key 176 to increase the system volume, and 174 to decrease it, so the script reads
CODE
xmodmap -e 'keycode 174=F21' #voldown
xmodmap -e 'keycode 176=F22' #volup


Don't forget to make this executable. Run this script, re-run xev and you should now see, for example, F22 or F21 in the even notification.

The final step is to make F21 or F22 (or whatever you called your keys) actually do something useful. You can do this using the existing shortcut options (if you wish it to start an application), or you can use the program xbindkeys, here - http://hocwp.free.fr/xbindkeys/xbindkeys.html . This program links key events to bash commands, very easily.

The script in the KDE Autostart folder can then be modified to launch xbindkeys when KDE is launched, and the file ~/.xbindkeysrc modified to link the key events to the desired bash commands. I used dcop (the inter-program communication process) to tell kmix (the default KDE mixer) to increase/decrease the master volume (channel 0) whenever the relevant keys were pressed. Below is the complete file ~/.kde/Autostart/keycodes (MUST be executable):
CODE
#!/bin/sh
#file to map special keys.
#File location: ~/.kde/Autostart
#File Name:keycodes

xmodmap -e 'keycode 174=F21' #voldown
xmodmap -e 'keycode 176=F22' #volup

#Open kmix to allow xbindkeys to work:
kmix

#Open xbindkeys to link keys to applications:
xbindkeys
and the few lines I had to add to ~/.xbindkeysrc:
Code:
#Volume decrease
"dcop kmix Mixer0 decreaseVolume 0"
 F21

#Volume increase
"dcop kmix Mixer0 increaseVolume 0"
 F22



Hopefully this will help people make their keyboards more useful. If anyone has any further suggestions, or knows of obvious or important differences between desktop environments, please post them below. However it should be relatively distro/desktop independent.

 

 

 


Comment/Reply (w/o sign-up)

cryptwizard
That's very useful.
I'll be looking back to this when I get a keyboard with hotkeys.

Comment/Reply (w/o sign-up)

the empty calorie
Ugh, I hate hotkeys. I always had them disabled on my laptop, because if you'd accidentally press one, you would end up having to wait a minute (painfully slow computer) just to close whatever you opened.

Comment/Reply (w/o sign-up)

cryptwizard
Good point.
That happened to me a few times at school once.
Even if your keyboard doesn't have hotkeys, the F1 (Help) button can be annoying when you're reaching for the F2 (Rename) button.

Comment/Reply (w/o sign-up)

FeedBacker
Rally good, I've been looking for something like this. I hate exit from full screen mode just to increase the volume.

-reply by physlord

Comment/Reply (w/o sign-up)

FeedBacker
A better hotkey system (or different at least)
Hotkeys / Keyboard Quick Launch Keys In Linux

Is it possible to listen to those keystrokes, keep them in a buffer, and setup hotkeys, then have a "fire" key that actually launches programs? Ideally then if you type in the say "ff[tab]" firefox would open, etc.



-reply by joseph

Comment/Reply (w/o sign-up)


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Similar Topics

Keywords : hotkeys, keyboard, quick, launch, keys, linux

  1. Linux Partitioning Guide (new Users)
    A very basic guide to partitioning in linux designed for new users (1)
  2. Linux Beginners - Tutorial On Editors In Linux.
    (3)
    This is a simple tutorial on the editors in Linux. I use these 3 editors for programming on linux:
    1. vi -- available in all Linux and unix box, used to edit 2. vim -- not in all Linux flavors
    and it has got default coloring of key words feature, used to edit 3. view --Its used only to
    view, recommended to use for viewing of system config files, as it should not get edited without
    your notice. Following are the basic commands comes handy with these editors #Open a file for
    edit $ vi test -- creates a file if file is not exist in the current directory $ v....
  3. Adding Ttf Fonts To Your Linux
    so you can really get into gimping :) (0)
    Using ttf fonts in Linux While working in Linux and wanting to work with the GIMP, I mainly
    lacked my fonts, the ones I had in Windows, so needless to say I had to fix this. So here is how I
    do it /smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> First you
    will have to make a folder to store your ttf fonts in, normally I use /usr/share/fonts/ttf/ as
    folder. You will have to do this as root, so CONSOLE su - (password) mkdir /usr/share/fonts/ttf/
    chmod 755 /usr/share/fonts/tff What we did here, was with "su -" change the user ....
  4. Installing Photoshop 7 On Linux (fedora)
    Needs windows installation (10)
    Hi, well I've tried coping with The GIMP but could never get it to make smaller compressed file
    sizes, so I had to cheat and use Adobe Photoshop 7, however, I use to switch over to Windows to do
    this, and it was only for compressing the file, so I thought, how about getting Adobe Photoshop 7
    working with Linux (no, I am not kidding!), well here's my steps on how to do this. (tested and
    verified that it works, not completely tested though). Also working off by memory so I do apologise
    if some things aren't correct, but I know it's near enough that you sho....
  5. Demystifying "chmod" - Part 1
    & why viruses get so retarded on Linux (7)
    Hi,     Today we are going to learn a bit about *NIX command chmod or "change mode" - which could
    be referred to as the *NIX counterpart of the MS-DOS/Windows attrib command. Our objective here is
    to understand the way File Permissions work on *NIX systems and be able to srt/change file
    permissions according to our needs. Recently there have been a lot of questions flyig around about
    viruses on *NIX systems - so along with this I'll briefly try to explain HOW the *NIX file
    permissions make it so hard for viruses to operate successfully in such an environment.   ....
  6. Howto: Setup Your Own DHCP Server On Linux
    And have it to allot IPs dynamically (0)
    Howto: Setup a DHCP Server on Linux in Few Simple Steps Hi all,     I'm back again with a
    new turorial - this time we're going to deal with another aspect of Linux/Windows networking -
    the DHCP Server . I'm sure all of you must have come across the term DHCP - anyone who connects
    to the internet has to come across it every now and then. You see the term even on the small setup
    instructions leaflets that accompany the dial-up internet packages from most of the ISPs. DHCP is
    what allots you a unique IP address everytime you dial out to your ISP. Here'....
  7. Linux Tutorials List
    Lets all chip in... (0)
    Hi all /smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> Lets
    all chip in an maintain the most complete list of Linux Tutorials here. I believe there's a
    similar post somewhere in one of the OS Forums - admins, it would do good if you could move it in
    here. Thanks. Here's one for a starter - for user's migrating from Windows to Linux, the
    IBM Windows-to-Linux Roadmap Series: http://www-106.ibm.com/developerworks/linu.../l-roadmap.html ....
  8. Howto: Setup Windows NT/2K Domain Using SAMBA
    and make Windows 2000 Logon to Linux (9)
    Howto: Setup and emulate a Windows NT Domain on Linux and make Windows 2000/XP log on
    =========================================================================== HI all, I'm
    back with another Tutorial in the Linux series. This time we're going to with an issue that is
    very common in everyday networking and is implemented almost everywhere in some form or the other.
    The primary issue here is to make two DIFFERENT Operating Systems talk to each other over the
    network and synchonize and share files without letting off any hint about the complex protocols i....
  9. Howto: Domain Name Server On Linux
    DNS for your Intranet (or Internet) Serv (7)
    HOWTO: Setup a Local Domain Name Server (DNS) for your Intranet
    ==================================================================== Experimentation Platform:
    ------------------------- Intel P4 3.0Ghz (Intel MB) 1 GB RAM 2 x 80 GB HDD on RAID 1 (Disk
    Mirroring) - alloted entirely to Linux OS: ------------------------- Linux - Redhat Enterprise AS
    Server v3 Note: a. I was trying to setup the system so that later on when my server goes
    online, I don't have to modify much to make my nameservers work with the internet - so I used my
    registered domain "mi....
  10. Using Ntloader To Boot Linux
    Win2K or XP, should work with most Linux (3)
    Basically what we're going to do with NTLoader is use NTLoader to boot into Linux's
    bootloader which then boots Linux, why someone would do that when Grub works perfectly fine booting
    Windows on NTFS? Who knows what reason other than it could destroy their MBR and make both OS
    inaccessible or at least render Linux useless till it's recovered, NTLoader is not specifically
    designed to boot other Operating Systems other than Windows. We will be using 2 Hard Drives, this
    is not necessary, we could use 2 partitions on a hard drive, but we should have the Operati....
  11. Networking Linux and Windows
    (4)
    For the life of me I can not figure out how to go about mounting my Windows share on my Linux box.
    I read somewhere that I needed to use Samba so I got that and I have no clue what to do. I am not
    very experienced with Linux and am using RedHat so if you could dumb it down and go through it step
    by step it would be great. Thanks alot.....
  12. Linux/Gnu
    (3)
    hmmm I am a friend of Gnu/Linux itself. I like the concept of Gnu/Linux, but as I have used Linux
    for a long time I have noticed that the hardware support is not the best. You can read which
    hardware is supported, but this is not the best way because if your printer e.g is claimed to be
    supported by cups on their website, it's not ensured that this printer is really supported. I
    had so many printers, which should run with cups (only an example) and at the end these printers
    then print pure crap . Another example are graphic adapters...I have 3 different cards and e....
  13. Some one know how to install my scanner
    Hp psc 1210 in linux suse (2)
    I have problen whit my Scanner the system detect this of hp scanjet all-in-one but this don't
    are scanjet this are PSC 1210, and I don't know how he does that. I browsing in google.com/linux
    for the driver and to in Hp.com but don't exist this drivers. You know where I download this
    drivers. /tongue.gif" style="vertical-align:middle" emoid=":P" border="0" alt="tongue.gif" />
    /tongue.gif" style="vertical-align:middle" emoid=":P" border="0" alt="tongue.gif" /> /tongue.gif"
    style="vertical-align:middle" emoid=":P" border="0" alt="tongue.gif" /> /biggrin.g....
  14. looks himself linux
    Don't fear him. (1)
    Is enough seemed to windows pruevalo.....
  15. Linux is well supported.
    Belive it or not (2)
    Believe it or not, it may be a lot easier to get patches and updates for Linux than for any
    proprietary operating system! The answer to a problem often comes back within a few hours after
    sending a message to some newsgroup or mailing list. Moreover, drivers for Linux are usually
    available a few weeks after new hardware products have been introduced on the market. By contrast,
    hardware manufacturers release device drivers for only a few commercial operating systems, usually
    the Microsoft ones. Therefore, all commercial Unix variants run on a restricted subset of hardware....
  16. Linux is highly compatible
    with many common operating systems. (0)
    It lets you directly mount filesystems for all versions of MS-DOS and MS Windows, SVR4, OS/2, Mac
    OS, Solaris, SunOS, NeXTSTEP, many BSD variants, and so on. Linux is also able to operate with many
    network layers like Ethernet, Fiber Distributed Data Interface (FDDI), High Performance Parallel
    Interface (HIPPI), IBM's Token Ring, AT&T WaveLAN, DEC RoamAbout DS, and so forth. By using
    suitable libraries, Linux systems are even able to directly run programs written for other operating
    systems. For example, Linux is able to execute applications written for MSDOS, MS Win....
  17. Linux is fully customizable in all its components.
    but is don't ease (0)
    Thanks to the General Public License (GPL), you are allowed to freely read and modify the source
    code of the kernel and of all system programs. Several commercial companies have started to support
    their products under Linux, most of which aren't distributed under a GNU Public License.
    Therefore, you may not be allowed to read or modify their source code.....
  18. Linux offers the following advantages over its com
    Linux is free. (0)
    8 You can install a complete Unix system at no expense other than the hardware (of course).....
  19. Linux Versus Other Unix-Like Kernels
    This is a Littler History (0)
    6 The various Unix-like systems on the market, some of which have a long history and may show signs
    of archaic practices, differ in many important respects. All commercial variants were derived from
    either SVR4 or 4.4BSD; all of them tend to agree on some common standards like IEEE's POSIX
    (Portable Operating Systems based on Unix) and X/Open's CAE (Common Applications Environment).
    Understanding the Linux Kernel 7 The current standards specify only an application programming
    interface (API) that is, a well-defined environment in which user programs should run. T....
  20. You Can Learn Linux: This Is A Little History
    (0)
    Linux is a member of the large family of Unix-like operating systems. A relative newcomer
    experiencing sudden spectacular popularity starting in the late 1990s, Linux joins such well-known
    commercial Unix operating systems as System V Release 4 (SVR4) developed by AT&T, which is now owned
    by Novell; the 4.4 BSD release from the University of California at Berkeley (4.4BSD), Digital Unix
    from Digital Equipment Corporation (now Compaq); AIX from IBM; HP-UX from Hewlett-Packard; and
    Solaris from Sun Microsystems. Linux was initially developed by Linus Torvalds in 1991 as an....
  21. "Demo" of Linux
    Knoppix (7)
    I found something interesting out here. For all us Windows-users who want to try Linux but
    can't, let me introduce Knoppix . I haven't tried it myself, and I'm a Windows user,
    but I certainly will try at some point.....
  22. Mplayer in Linux
    Best of Windows Media Player (5)
    Yes the program Mplayer is best of windows media player. You can download that every codec pack and
    skins. These program open your movies faster, and it does't matter that type be: DVD, VCD, AVI,
    ASF, MPG, DivX and XviD. These player is faster and ease for use. Ty it I assure you that pleased
    you. But it's only under Linux Use. this the screenshut:
    http://www.radikalsoft.com/img/Mplayer.jpg And you dont need to modific your region of DVD because
    mplayer have regionfree.....
  23. How to make your life in Linux most ease
    My life in Linux is now ease (18)
    The you can do is chage your linux to SuSE 9.1, These linux meke all for you. He install your modem,
    printer well your every hareware. The it brings software as mplayer to see movies (these are similar
    to Media Player), Xmms to play musicb (these are similar to Winamp), Kopete for every messengers,
    K3B for write yoour cd's and dvd's (these are similar to Nero), Mozilla (these are similar
    to Nestcape). And the best is that you do not have to pay for the lisence its free. And SuSE heve
    good games that Unreal tournamend, Quake 3, Medal of Honor and Wolfenstein Enemi....
  24. To all Linux users
    Linux counter for all Linux users (5)
    All Linux users, Linux community has a Linux counter which keeps track for Linux usuage all over
    the world. This counter is counting for since years and is still counting. All of you Linux users,
    should register that at http://counter.li.org/ It's run by a nonprofit membership
    organization called the Linux Counter Project. And BTW, I'm not affiliated with them. I just
    happen to be a Linux user for over 6 years.....
  25. FreeBSD? Linux?
    (2)
    Hi all. I've been working on Mandrake, RedHat. Now I use FreeBSD. Seem to be very robust and
    stable. Everything you can get from one point - it's ports collection on www.freebsd.org. One
    problem - there is no ALSA driver for it. What do you think about FreeBSD and Linux?....
  26. Linux
    (9)
    Linux is one of my favorite OS out there. It seems to have none of the problemes that windows have.
    Liux is free and I really like that free always equals good. But sometimes when I coldboot I takes
    forever to finally run .....

    1. Looking for hotkeys, keyboard, quick, launch, keys, linux

See Also,

*SIMILAR VIDEOS*
Searching Video's for hotkeys, keyboard, quick, launch, keys, linux
advertisement



Hotkeys / Keyboard Quick Launch Keys In Linux

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com