About Me

Mein Bild
Freelancing software developer / architect, mobile geek. Topics: Software technologies (java, groovy, agile), politics, web, science, green, mobile, android.
Homepage: www.tutaona.com

"The absence of limitations is the enemy of art." - Orson Welles

Montag, 21. November 2011

German Umlauts For US Keyboard

As a programmer and console lover I very much prefer the US keyboard layout but when writing in German I need a convenient way to access the German Umlauts. I also hate the capslock key as I always hit it by accident, so I want to remove it from my layout. Before I knew how to do this I even ripped off the cap from the capslock key. Here is how:

Create a user xmodmap config file:
gedit ~/.Xmodmap
Paste these key mappings inside:
! Umlauts with modifier RIGHT ALT + 
keycode 108 = Mode_switch
keysym e = e E EuroSign
keysym c = c C cent
keysym a = a A adiaeresis Adiaeresis
keysym o = o O odiaeresis Odiaeresis
keysym u = u U udiaeresis Udiaeresis
keysym s = s S ssharp
Activate instantly:
sudo gedit /etc/pm/sleep.d/50-xmodmap.sh
Did I mention that I hate the capslock key?
System Settings > Keyboard Layout > [your layout] > Options > Capslock key behavior = Caps Lock is disabled

External USB keyboard
The xmodmap trick doesn't work whe the computer resumes from suspend. So we have to execute xmodmap on resume.

#!/bin/bash

. /usr/lib/pm-utils/functions

case "$1" in
    hibernate|suspend)
    ;;
    thaw|resume)
xmodmap $HOME/.Xmodmap
    ;;
    *)
    ;;
esac

exit
Finally make is executable:
sudo chmod 755 /etc/pm/sleep.d/50-xmodmap.sh

Keine Kommentare:

Kommentar veröffentlichen