[LinuxFocus-icon]
LinuxFocus article number 351
http://linuxfocus.org

[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

idea

Abstract:

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

_________________ _________________ _________________

 

Introduction

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.


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

2005-01-14, generated by lfparser_pdf version 2.51