Keyboard layout for combining diacritics
Typically, if you want to type characters with accents, such as á, ë, ś, you need to configure a suitable keyboard layout that includes compose sequences for those characters. The produced characters are what we call as precomposed characters; which were included in the early stages of Unicode. Nowdays, the idea is that you do not need to define á as a distinct character because it can be represented as a and ´, where the latter is a combining diacritic.
When put together a character and a combining diacritic, they fuse together, producing a seemingly single character. á is a precomposed (really one character), while á is letter a and the combining diacritic called acute (two characters). You can type the latter á by
- Type a
- Press Ctrl+Shift+u, then type 301, then press space bar.
Western languages do not really require combining marks, so the existing keyboard layouts do not use them. Other scripts, such as the Congolese keyboard layout (based on Latin) make good use of them.
This is gedit showing off pango and DejaVu fonts (default font in major distributions).
Line 3 is a bit of an extreme, showing a sandwich of combining diacritics.
Line 4 shows the base character a with the combining diacritics from the Unicode range 0x300 to 0x315.
Both lines 3 and 4 were produced easily with a modified keyboard layout, which is show below.
Line 5 is just me being silly. You can have combining diacritics that enclose your base character.
$ cat /usr/share/X11/xkb/symbols/combining
partial alphanumeric_keys alternate_group
xkb_symbols "combining" {
name[Group1] = "Combining diacritics";
key.type[Group1] = "FOUR_LEVEL";
key <AD11> { [ NoSymbol, NoSymbol, 0x1000300, 0x1000301 ] }; // à á
key <AD12> { [ NoSymbol, NoSymbol, 0x1000302, 0x1000303 ] }; // â ã
key <AC10> { [ NoSymbol, NoSymbol, 0x1000304, 0x1000305 ] }; // ā a̅
key <AC11> { [ NoSymbol, NoSymbol, 0x1000306, 0x1000307 ] }; // ă ȧ
key <BKSL> { [ NoSymbol, NoSymbol, 0x1000308, 0x1000309 ] }; // ä ả
key <AB08> { [ NoSymbol, NoSymbol, 0x1000310, 0x1000311 ] }; // a̐ ȃ
key <AB09> { [ NoSymbol, NoSymbol, 0x1000312, 0x1000313 ] }; // a̒ a̓
key <AB10> { [ NoSymbol, NoSymbol, 0x1000314, 0x1000315 ] }; // a̔ a̕
};
$ diff -u /usr/share/X11/xkb/symbols/us.ORIGINAL /usr/share/X11/xkb/symbols/us
--- /usr/share/X11/xkb/symbols/us.ORIGINAL 2008-02-20 11:11:13.000000000 +0000
+++ /usr/share/X11/xkb/symbols/us 2008-02-20 13:02:07.000000000 +0000
@@ -492,3 +492,12 @@
name[Group1]= "U.S. English - Macintosh";
};
+partial alphanumeric_keys modifier_keys
+xkb_symbols "combining_us" {
+
+ include "us"
+ include "combining"
+
+ key.type[Group1] = "FOUR_LEVEL";
+ name[Group1] = "U.S. English - Combining";
+};
$ diff -u /usr/share/X11/xkb/rules/xorg.xml.ORIGINAL /usr/share/X11/xkb/rules/xorg.xml
--- /usr/share/X11/xkb/rules/xorg.xml.ORIGINAL 2008-02-20 11:27:00.000000000 +0000
+++ /usr/share/X11/xkb/rules/xorg.xml 2008-02-20 11:27:48.000000000 +0000
@@ -3643,6 +3643,12 @@
<description xml:lang="zh_TW">Macintosh</description>
</configItem>
</variant>
+ <variant>
+ <configItem>
+ <name>combining_us</name>
+ <description>Combining</description>
+ </configItem>
+ </variant>
</variantList>
</layout>
<layout>
$ _
Then, you select this keyboard layout (U.S. English) and variant (Combining) in the Keyboard Indicator applet.
Unlike dead keys, with combining diacritics you first type the base character (such as a) and then any combining diacritics.
Our sample layout variant puts the diacritics in the physical keys for [];'#,./. For example,
- a + AltGr+[ : à
- a + AltGr+Shift+[ : á
- a + AltGr+[ + AltGr+' : ằ
If your language has needs that can be solved with combining diacritics, this is how they are solved.
It is quite important to create keyboard layouts for all languages, and actually make good use of them.
task update (el)
Ακολουθώντας το παράδειγμα του Δημήτρη για συνοπτική ενημέρωση των πεπραγμένων,
- Πρόσθεσα τις μεταφράσεις του Γιάννη Κατσαμπίρη στο SVN του GNOME. Έκανα έλεγχο των μεταφράσεων και έστειλα σχόλια στη λίστα του gnome.gr. Ο Γιάννης μετέφρασε ή ενημέρωσε τις μεταφράσεις για τα vinagre, gnome-mag, mousetweaks, mousetweaks-help.
- Έκανα σχόλια στο http://laptop.grinia.net/ για τη διαβούλευση για το μαθητικό υπολογιστή. Βλέπω ότι δεν έχουν γίνει πολλά σχόλια από άλλους. Είναι καλό να το κάνετε.
- Πρόσθεσα το ιστολόγιο του Αλέξανδρου στον πλανήτη. Ανταλλάξαμε μερικά γράμματα για κάποια τεχνικά ζητήματα (μια εγγραφή είχε ένα χαρακτήρα που δεν είναι utf-8 οπότε όλο το feed φαινόταν με ?????, πως μπορούμε να συνδιάσουμε κατηγορίες του wordperss για τη δημιουργία πιο κατάλληλου feed, χρήση του feedburner). Απομένουν: χρήση των ειδικών βελτιώσεων του feedburner όπως αναγραφή αριθμού σχολίων. Χμμ, ολόκληρες εγγραφές στο feed;
- Έστειλα γράμματα στη λίστα εξελληνισμού του μαθητικού υπολογιστή για 1) υπενθύμηση του glossary που παρέχει το ellak.gr για όρους πληροφορικής (μπορεί κάποιος να κάνει σχόλια/αλλαγές), 2) αναφορά για τη μετάφραση του eToys (τώρα είμαστε στο %6).
- Πριν από μερικές εβδομάδες έγινε δεκτό το patch για την ελληνική διάταξη πληκτρολογίου, για τη χρήση των συμβόλων dead_psili, dead_dasia. Αυτό σημαίνει ότι στις νέες διανομές του Μαρτίου/Απριλίου το πολυτονικό θα δουλεύει, αλλά μπορεί και όχι...
- Στάλθηκε patch για την υποστήριξη του πολυτονικού από το GTK+· λόγω του σχεδόν κλειστού παραθύρου για εισαγωγή νέων χαρακτηριστικών στο GTK+, αυτό θα μπει μάλλον αργότερα, στην επόμενη έκδοση.
- Όταν κάνεις αποπροσάρτηση ενός τόμου/συσκευής USB, το σύστημα δεν θέτει τη συσκευή σε κατάσταση εκτός λειτουργίας ή χαμηλής κατανάλωσης. Αυτά σε Nautilus αλλά πιστεύω και αλλού. Δεν έχουν όλες οι συσκευές τη δυνατότητα αυτή και φαίνεται ότι δεν έχω ούτε μία τέτοια συσκευή (που να υποστηρίζει off-standby). Από την άλλη πλευρά, το VirtualBox κατάφερε να θέσει μια τέτοια συσκευή σε κατάσταση off (πώς το έκανε!;!;) Η προσθήκη υποστήριξης είναι στο TODO για τώρα.
- Το Σ/Κ θα είμαι στις Βρυξέλλες για το FΟSDΕΜ!
Ενημέρωση: σύνδεσμος με τα σχόλια από τη διαβούλευση.
Create flash videos of your desktop with recordmydesktop
John Varouhakis is the author of recordmydesktop and gtk-recordmydesktop (front-end) which is a tool to help you record a session on your Linux desktop and save it to a Flash video (.flv).
To install, click on System/Administration/Synaptic Package Manager, and search for gtk-recordmydesktop. Install it. Then, the application is available from Applications/Sound&Video/gtkRecordMyDesktop.
Before you are ready to capture your Flash video, you need to select the video area. There are several ways to do this; the most common is to click on Select Window, then click on the Window you want to record. A common mistake is that people try to select the window from the preview above. If you do that, when you would have selected the recorder itself to make a video of, which is not really useful. You need to click on the real window in order to select it; then, in the desktop preview you can see the selected window. In the above case, I selected the OpenOffice Writer window.
Assuming that you do not need to do any further customisation, you can simple press Record to start recording. Generally, it is good to check the recording settings using the GNOME Sound recorder beforehand. While recording, you can notice a special icon on the top panel. This is gtk-recordmydesktop. Once you press it, recording stops and the program will do the post-processing of the recording. The resulting file goes into your home folder, and has the extension .ogv.
Some common pitfalls include
- I did not manage to get audio recording to work well for my system; I had to disable libasound so that the audio recording would not skip. With ALSA, sound skips while with OSS emulation it does not. Weird. Does it work for you?
- The post-processing of the recording takes some time. If you have a long recording, it may take some time to show that it makes progress, so you might think it crashed. Have patience.
I had made one such recording, which can be found at the Greek OLPC mailing list. John told me that the audio part of the video was not loud enough, and one can use extra post-processing to make it sound better. For example, one could extract the audio stream of the video, remove the noise, beautify (how?) and then add back to the video.
It's good to try out gtk-recordmydesktop, even for a small recording. Do you have some cool tips from your Linux desktop that you want to share? Record your desktop!
Writing J2ME applications in Linux
Here is an interesting article on writing J2ME applications in Linux.
J2ME applications is software that runs on mobile phones that support Java applications. Most phones support such Java applications, and it's good to get your phone to run at least your own Hello, World! program.
Typing squiggles and dots in GNOME and GTK+ applications
Garrett asks how to type squiggles and dots in GNOME; that is, how to type characters such as á à ä ã â ą ȩ ę ő ǰ ǩ ǒ ġ ṅ ȯ ṁ ė.
There are several ways, and one can choose depending on how frequently they need to type them or how much time they need to invest learning.
① One option is to start the Character Map (Applications/Accessories/Character Map), pick the character, copy and paste it. This is good for rare characters and weird situations such as
┏━━━━━━━━━━━━━━━━━━━━━━━┓
⟁⟁⟁⟁♥♀★★▶◀☆♀░░░▒▒▒▓▓▓▙▚▛▙▙▙▞
The Unicode standard, apart from defining characters for languages, it also defines symbols, dingbats and all sort of things. If your distribution is based on the DejaVu fonts (such as Ubuntu), then you are probably covered for many of these symbols. If you do not have a suitable font, or you use Windows, you will be wondering what the hell I am talking about.
② Another option is to use the Character Palette applet which shows an applet on the panel with a configurable small repertoire of characters such as áàéíñó½©ث€. You select one of the characters with the mouse, and wherever you middle-click, this character is typed. This is an improvement over ①, and good when you want to type often rare characters. It is not convenient to type characters found normally on a keyboard layout.
③ To type characters normally found in a specific language(s), it is good to setup a suitable keyboard layout. For this, it is good to add the Keyboard Indicator applet; right click on the panel, click Add to panel... and choose the Keyboard Indicator from the Utilities section. The US English keyboard layout (Default variant) does not provide any interesting characters apart from those shown printed on the keys of a US Keyboard.

The US English International (with dead keys) variant might be a better option,
Or the United Kingdom layout.
You can get a similar image for your layout when you right-click on the Keyboard Indicator applet, then click Show Current Layout.
Each key in the images contain up to four letters. Starting from bottom-left and going clock-wise, these are the keys produced when
ⓐ you press the key
ⓑ you press the key with Shift (or Caps Lock)
ⓒ you press the key with AltGr and Shift (or Caps Lock)
ⓓ you press the key with AltGr
For example, with the UK keyboard layout, the key G produces g, G, Ŋ, ŋ.
If AltGr + Shift + letter does not work for you, see the FDO Bug #2871 Different results for shift-altgr and altgr-shift.
Using the appropriate keyboard layout is the way to go when writing text that require squiggles. You can either choose a layout with dead keys (meaning that some keys lose their normal functionality), or you can pick a layout that still allows you to have dead keys but are available when you press AltGr + key. For example, in the UK Keyboard layout - Default variant, AltGr + ; + a produces á, or AltGr+Shift+]+e produces ē.
Photo by titanas.The OLPC uses those four level for the keyboard layout. You can see the all the variations printed on the keyboard. Click on the image, choose Large size for the details.
④ Another option to produce more characters on the keyboard is to enable the compose key, and use compose sequences. A compose sequence looks similar to what we described above (i.e. AltGr+Shift+]+e to ē) but the idea is that we use it for characters we want to be available across different keyboard layouts that you may have enabled.

The compose key is very powerful functionality, thus it is not enabled by default, and lays hidden in the Layout Options tab. I prefer to set it to Menu, but every person has their own preference.
For example,
- Compose key + - + a produces ã,
- Compose key + < + c produces č
- Compose key + 1 + s produces ¹ (Superscript on 1. Try to replace 1 with 2.)
- Compose key + + + - procudes ±
Currently, GTK+ provides 640 such compose sequences involving the Compose key, and hopefully soon it will increase to over 3000.
The Compose key is known as Multi_key in the source code (Xorg, GTK+, etc).
The Compose key compose sequences offer the ability to define smart mnemonics on how to produce characters. It is much easier to type ComposeKey + 1 + s rather than remembering the codepoint value of ¹ (1 superscript). As with many things open-source, there are too many options, and with the Compose key there is the issue of which shall we pick as a sensible default, and how to make it prominent for those who might want to use it.
It appears to me that there should be more effort to promote the functionality that is provided with the standard keyboard layouts (choose a better keyboard layout, produce characters provided in the third and fourth levels, etc). In this respect, Compose key compose sequences should complement after the main discussion on keyboard layouts take place.
⑤ There is a last issue on switching keyboard layouts to cover in a separate post.



