Modifying the keyboard layout

Asked by صقر بن عبدالله

Just wanted to know how to modify my Arabic language keyboard layout to include several extended characters of Arabic and punctuation.

Is there a software that can help me create my custom keyboard and install it on Ubuntu?

Thanks

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Simos Xenitellis 
Solved:
Last query:
Last reply:
Revision history for this message
Bjørn Sandåker (prognatus) said :
#1

I'm uncertain if this meets your request (because I can't read the page), but take a look at http://www.gerdi.net/

There are some controls which might help you in System->Preferences->Control Center->Keyboard Preferences too, if you haven't looked at them already.

Revision history for this message
Best Simos Xenitellis  (simosx) said :
#2

There are no graphical tools (that I know of) to edit the keyboard layouts. If you wish to do it the manual way, you need to edit the file
/usr/share/X11/xkb/symbols/ara

In that file you can see many variants of the Arabic keyboard. Pick the one you use and then add if there is space the characters you wish. You can find the Unicode value of the character from Applications/Accessories/Character Map.
If there is no space in the keyboard layout you use, you can convert it to a THREE_LEVEL (see for example "gr" in /usr/share/X11/xkb/symbols/). Then you can add a third column which can be invoked when you press AltGr+<key>. (The first column of values in the square brackets is for letters you press as is, the second when you press with Shift).

This generic page can also help you,
http://www.jw-stumpel.nl/stestu.html

Revision history for this message
صقر بن عبدالله (agari) said :
#3

I attempted to modify the keyboard layout as Simos Xenitellis suggested, but I am unable to save the file, and if I attempt to replace the file with a modified version through copy and paste, I am told that I have no permission to change it or its parents folder. How do I fix that?

Revision history for this message
Simos Xenitellis  (simosx) said :
#4

The specific file is protected by your system. It is important when you do testing, to save a backup of the file so that you can revert back if something goes wrong.

I recommend that you check
https://help.ubuntu.com/
and in the Advanced section it mentions how to use the command line and "sudo". You need to use "sudo" to get temporary administrative privileges so that you can edit the file.

In a nutshell,

To make a backup of the Arabic keyboard layout file
sudo cp /usr/share/X11/xkb/symbols/ara /usr/share/X11/xkb/symbols/ara.ORIGINAL

To edit the Arabic keyboard layout file
sudo /usr/share/X11/xkb/symbols/ara

To revert back to the backup copy of the Arabic keyboard layout file
sudo cp /usr/share/X11/xkb/symbols/ara.ORIGINAL /usr/share/X11/xkb/symbols/ara

You will be asked for your password when running the above lines.
Once you make a change in the "ara" file, you need to go to the Keyboard Indicator, remove the Arabic layout and add it again. In this way it will refresh it for you and you do not have to reboot.
Make sure you understand these commands. Try with a small change first.
Good luck!

Revision history for this message
صقر بن عبدالله (agari) said :
#5

I did that, made a small change, the "division" to U+00AB and the "multiply" to U+00BB and saved it. The problem I got was after removing the Arabic layout from the Keyboard Indicator and adding it again, I got an error saying "Error activating XKB configuration." On the bottom of the error dialog it says I should include this if I report this as a bug:
"The result of xprop -root | grep XKB
The result of gconftool-2 -R /desktop/gnome/peripherals/keyboard/kbd"

I'm actually glad I got this far, but I don't know why this reported an error. Was there an extra thing I had to do? Or did I have to enter the symbols in the file in a different form than the Unicode form? Because the "multiply" and "division" where just like that and not in Unicode format.

Thanks again Simos

Revision history for this message
Simos Xenitellis  (simosx) said :
#6

Can you please show me the change you made?
You can post the lines that you added or changed.

Revision history for this message
صقر بن عبدالله (agari) said :
#7

aha! I found it, I used U+00AB and U+00BB when I should have used the utf-16 format which is 0x00AB and 0x00BB.

That was the "bug". It works fine now. Thanks

Revision history for this message
صقر بن عبدالله (agari) said :
#8

Thanks Simos Xenitellis, that solved my question.

Revision history for this message
delipasha (markodelac) said :
#9

If you made some Ottoman letters please send the layout to me. Thanks..

Revision history for this message
Sinama.org (sinama.org) said :
#10

Is it possible that in the most recent version of Ubuntu these file locations have changed? I cannot find them at that location. There is no symbols folder. If anyone can help with this, thanks.

Revision history for this message
Tom K. C. Chiu (tomchiukc) said :
#11

Make sure you have the "X11" in the path has a capital "X" instead of a lowercase "x".

Revision history for this message
Sinama.org (sinama.org) said :
#12

I figured out my problem. I was reading from two sets of instructions and the other set was sending me to the /etc/ folder instead of the /usr/share/. Thanks for the response.