20 April, 2009

Dvorak DE Layout

Followind the idea described here I defined a Dvorak Keyboard Layout extension allowing me to input the german umlauts and sharp 's' by pressing AltGr. To use, create a file /usr/share/X11/xkb/symbols/us_dvorak_de containing this:
// us_dvorak_de: Custom extended us keymap

default
partial alphanumeric_keys
xkb_symbols "dvorak-de" {
  name[Group1]= "USA - Dvorak DE";


  include "us(dvorak)"
  include "level3(ralt_switch)"

  key <AC03> {[ e,            E,           EuroSign,       U2203           ]};
  key <AD09> {[ r,            R,           registered                      ]};
  key <AC08> {[ t,            T,           trademark                       ]};
  key <AC04> {[ u,            U,           udiaeresis,     Udiaeresis      ]};
  key <AC02> {[ o,            O,           odiaeresis,     Odiaeresis      ]};
  key <AC01> {[ a,            A,           adiaeresis,    Adiaeresis       ]};
  key <AC10> {[ s,            S,           ssharp                          ]};
  key <AC06> {[ d,            D,           degree                          ]};
  key <AD08> {[ c,            C,           copyright,     cent             ]};
  key <AB07> {[ m,            M,           mu                              ]};
  key <AD02> {[ comma,        less,        lessthanequal, lessthanequal    ]};
  key <AD03> {[ period,       greater,     ellipsis,      greaterthanequal ]};
};
The most reliable way to activate the layout seems to be:
setxkbmap -option lv3:ralt_switch,grp:lwin_toggle us,bg,us_dvorak_de ,,dvorak-de
Better is to specify this in /etc/default/console-setup, e.g.:
XKBMODEL="pc105"
XKBLAYOUT="us,bg"
XKBVARIANT="dvorak-intl,"
XKBOPTIONS="grp:lwin_toggle,lv3:ralt_switch"