logo
Published on Fedora Tunisia (https://fedora-tn.org)

Setting your X11 keyboard layout

By Swobodin
Created 2006-05-26 10:34
Sometimes, you may need more characters than the ones that are available on your keyboard; therefore you look for the specified character in a text that contains it, or a program like charmap, copy the character and paste it, which is not always successful, especially in compatibility Gtk/Qt.
With X11, it's possible to customize your keyboard keys in any language layout you want.
For example: I use a standard US QWERTY keyboard with Arabic letters, but I need some Latin special characters to type in Spanish or so. Hence the need for adding special characters to the keyboard.
To configure your keyboard layout, edit the US International (us_intl) file, which can be found at /usr/X11R6/lib/X11/xkb/symbols/pc/us_intl in earlier Fedora Core versions, and at /usr/share/X11/xkb/symbols/us in Fedora Core 5, where the international layout is included within the main one as a subsection called intl-alt.
Backup the file (who knows?) before editing it.
As you can see, not all keys are listed, only the ones that differ from the standard US layout.
The structure is like the following
key <[code]> { [         lower,          upper,        metalower,         metaupper ] };
Where:
Example, the key containing both apostrophe and double quote symbols will be set as the following: Lower: apostrophe, Upper: Double quote, Meta lower: Dead acute (When typed, will be waiting for a vowel to make an accented character, eg.: á, é, í, Ó, Ú, ...), Meta Upper: Dead diaeresis (trema as in German ü or in French ë)
Key setting should be the following:
key { [ apostrophe, quotedbl, dead_acute,   dead_diaeresis         ] };
After you have configured your keys, update your keyboard layout
setxkbmap us_intl
If there's no error, then your configuration should be correct, else check your syntax. If you can't find the nistake (There's no debug here), restore your original file.
If everything goes well, modify to your /etc/X11/xorg.conf
Section "InputDevice"

        Identifier  "Keyboard0"
        Driver      "kbd"
        Option      "XkbModel" "pc105"
        Option      "XkbLayout" "us_intl"
EndSection
I attached my configuration files that you may download and use, copy it to your symbols/pc folder if you run an old Fedora version or insert the lines containing configuration instead of the original ones if running Fedora Core 5.

Source URL:
https://fedora-tn.org/?q=node/100