<--  | Map  | Index  | Search

News | Archives | Links | About LF
This document is available in: English  Castellano  ChineseGB  Deutsch  Francais  Italiano  Nederlands  Portugues  Russian  Turkce  Polish  

[Photo of the Author]
by Guido Socher (homepage)

About the author:

Guido likes Linux because of the community. It is a huge project and somehow all the different people around the world are working towards the same goal: Making it better every day.



LF Tip: Changing the keyboard layout on the fly



This is a small tip. From now on LinuxFocus will have at least one new tip every month. If you have some ideas for a new tip then send them to guido(Q)linuxfocus.org

_________________ _________________ _________________



When I write a text on the computer I have my eyes on the screen and not the keyboard. Recently I visited a friend in France and he borrowed me his computer for a while. French keyboard layout! It took at least 10 seconds per key to find it because I am used to US or German keyboards ;-)
I did not want to edit the /etc/X11/XF86Config-4 as it was his PC. .... KDE and Gnome have some tools to change the keyboard layout but it did not seem to be installed here. What now?  

The solution

XFree86 has a standard command called setxkbmap which you can use to change the layout on the fly (no X server restart). It is similar to the loadkeys command on the Linux console.
I typed:

setxkbmap -layout us

and voila I had a US keyboard layout. Before
I gave to computer back to my friend I just typed:

setxkbmap -layout fr

and it was as if nothing was changed.

Talkback form for this article

Every article has its own talkback page. On this page you can submit a comment or look at comments from other readers:

Webpages maintained by the LinuxFocus Editor team
© Guido Socher
"some rights reserved" see linuxfocus.org/license/
Translation information:
en --> -- : Guido Socher (homepage)

2004-10-25, generated by lfparser version 2.50