German umlauts in X

Hello community,

I try to get German umlauts running on my FreeBSD machine. I have found tips like here:

http://de.answers.yahoo.com/question/index?qid=20060926041754AAVx4W3

To do this via the Alt Key. But this is not working. My current configuration in .cshrc is
Code:
setenv LANG=en_GB-UTF-8
and I use in my /etc/login.conf
Code:
:charset=UTF-8:\
:lang=en_GB.UTF-8:

I do not want to miss the English keyboard setup, but I need the umlauts as well. How can I use them?

Best regards,
eyebone
 
I never need a semicolon with a non-whitespace character after it, so I make that key dead_horn and use it to compose accents. When you want a semi-colon hit the key twice or hit it followed by spacebar or enter. To get this functionality:

~/.Xmodmap
Code:
keycode 47 = dead_horn colon

/.XCompose (my additions/modifications to UTF-8 (Unicode) compose sequence by David.Monniaux@ens.fr)
Code:
<dead_horn> <space> : "; "
<dead_horn> <Return> : ";\n"
<dead_horn> <dead_horn> : ";"

# accents

# acute
<dead_horn> <a> <e> : "é"
<dead_horn> <a> <E> : "É"

# cedilla
<dead_horn> <d> : "ç"
<dead_horn> <D> : "Ç"

# circumflex
<dead_horn> <c> <a> : "â"
<dead_horn> <c> <A> : "Â"
<dead_horn> <c> <e> : "ê"
<dead_horn> <c> <E> : "Ê"
<dead_horn> <c> <i> : "î"
<dead_horn> <c> <I> : "ÃŽ"
<dead_horn> <c> <o> : "ô"
<dead_horn> <c> <O> : "Ô"
<dead_horn> <c> <u> : "û"
<dead_horn> <c> <U> : "Û"

# grave
<dead_horn> <g> <a> : "à"
<dead_horn> <g> <A> : "À"
<dead_horn> <g> <e> : "è"
<dead_horn> <g> <E> : "È"
<dead_horn> <g> <u> : "ù"
<dead_horn> <g> <U> : "Ù"

#
<dead_horn> <s> : "ß"

# diaeresis (tréma, ümlaut)
<dead_horn> <t> <a> : "ä"
<dead_horn> <t> <A> : "Ä"
<dead_horn> <t> <e> : "ë"
<dead_horn> <t> <E> : "Ë"
<dead_horn> <t> <i> : "ï"
<dead_horn> <t> <I> : "Ï"
<dead_horn> <t> <o> : "ö"
<dead_horn> <t> <O> : "Ö"
<dead_horn> <t> <u> : "ü"
<dead_horn> <t> <U> : "Ü"

# currency
<dead_horn> <u> <1> : "¢"
<dead_horn> <u> <2> : "€"
<dead_horn> <u> <3> : "£"
<dead_horn> <u> <4> : "Â¥"

# math / science symbols

<dead_horn> <minus> : "÷"
<dead_horn> <equal> : "×"
<dead_horn> <underscore> : "±"
<dead_horn> <8> : "•"
<dead_horn> <0> : "°"
<dead_horn> <5> : "‰"
<dead_horn> <p> : "¶"
 
For Xorg, I wrote myself this extension for the us keymap to get access to German umlauts and other special characters:

Code:
// Layout file for programmers in Germany typing on US keyboards.
// German Umlauts and the Eszett are available on <rAlt>+<a>, <rAlt>+<o>,
// <rAlt>+<u> and <rAlt>+<s>. All deadkeys are on the rAlt layer, no
// deadkeys for symbols used on the shell or in programming languages.

partial alphanumeric_keys
xkb_symbols "dev-de" {
  name[Group1]= "USA - German developers";
  include "us(basic)"
  include "ctrl(nocaps)"

  key <TLDE> { [      grave, asciitilde,    dead_grave,       dead_tilde        ] };
  key <AE01> { [          1, exclam,        onesuperior,      exclamdown        ] };
  key <AE02> { [          2, at,            twosuperior,      twosuperior       ] };
  key <AE03> { [          3, numbersign,    threesuperior,    paragraph	        ] };
  key <AE05> { [          5, percent,       EuroSign                            ] };
  key <AE06> { [          6, asciicircum,   dead_circumflex,  onequarter        ] };
  key <AE07> { [          7, ampersand,     dead_horn,        onehalf           ] };
  key <AE08> { [          8, asterisk,      degree,           threequarters     ] };
  key <AE09> { [          9, parenleft,   leftsinglequotemark,  dead_breve      ] };
  key <AE10> { [          0, parenright,  rightsinglequotemark, dead_abovering  ] };
  key <AE11> { [      minus, underscore,    dead_macron,      dead_belowdot     ] };
  key <AE12> { [      equal, plus,          dead_doubleacute, dead_horn         ] };

  key <AD03> { [          e, E,             EuroSign,         cent              ] };
  key <AD07> { [          u, U,             udiaeresis,       Udiaeresis        ] };
  key <AD09> { [          o, O,             odiaeresis,       Odiaeresis        ] };

  key <AC01> { [          a, A,             adiaeresis,       Adiaeresis        ] };
  key <AC02> { [          s, S,             ssharp,           S                 ] };
  key <AC10> { [  semicolon, colon,         dead_ogonek,      dead_diaeresis    ] };
  key <AC11> { [ apostrophe, quotedbl,      dead_acute,       dead_diaeresis    ] };

  key <AB01> { [          z, Z,             ae,               AE                ] };
  key <AB02> { [          x, X,             oe,               OE                ] };
  key <AB07> { [          m, M,             mu,               mu                ] };
  key <AB08> { [      comma, less,          dead_cedilla,     dead_caron        ] };
  key <AB09> { [     period, greater,       dead_abovedot,    dead_circumflex   ] };
  key <AB10> { [      slash, question,      dead_hook,        U2E2E             ] };

  include "level3(ralt_switch)"
};

Add this at the end of the file /usr/share/X11/xkb/symbols/us (please make a backup copy first).

To activate while X is running, type this in an xterm:
$ setxkbmap us dev-de

If this fits your needs, either put the above command in your .xinitrc or make it default for all users by modifying /etc/X11/xorg.conf.
 
I'm switching between layouts with my unused windows key.

My ~/.xinitrc looks like this:
Code:
[pman]setxkbmap[/pman] -model pc105 -layout de,us -variant latin9 -option grp:lwin_toggle
 
Back
Top