While setting up new installation on my laptop (ending up with AVLinux, based on Debian Squeeze and Awesome window manager), there are million little things that don’t work exactly how I want and spend too many hours on fine-tuning it. In fact, one of the things didn’t really manage to setup in the last incarnation of running OS (Ubuntu, Gnome 2) was keyboard layout. So now I managed to do it propertly – the Right Way – by editing some conf files.
So, the basic system to keyboard layouts nowadays is XKB. Layouts that XKB loads are in /usr/share/X11/xkb/symbols
. I modified a slovenian layout and added a variant. At the end of /usr/share/X11/xkb/symbols/si
I added:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
partial alphanumeric_keys xkb_symbols "usprog" { name[Group1]= "Slovenia - Based on basic US with dead keys for Slovenian letters"; include "us(basic)" key <AB03> { [ c, C, ccaron, Ccaron ] }; // c C č Č key <AC02> { [ s, S, scaron, Scaron ] }; // s S š Š key <AB01> { [ z, Z, zcaron, Zcaron ] }; // z Z ž Ž key <AC03> { [ any, any, dstroke, Dstroke ] }; // d D đ Đ key <AC11> { [ apostrophe, quotedbl, cacute, Cacute ] }; // ' " ć Ć key <AE05> { [ 5, percent, EuroSign, dead_cedilla ] }; // € include "level3(ralt_switch)" }; |
This will give me a layout I can load with setxkbmap si usprog
. The basic idea of this layout is that it is a full basic “us” layout with additional ways for three slovenian letters č, š and ž, and “serbo/croat” ć and đ. They are accessible using AltGr (right Alt) key and keys c, s, z, ‘ and d. Simple as that. AltGr + 5 provides an additional Euro currency sign.
The next step would be to create this configuration in a local (under ~/ home) location. A -config
option to setxkbmap command should be the way to go, i guess.