Gentoo: US International keyboard with AltGr

Update: I’m updating this from time to time, whenever new things get added. These seem to be the minimal changes to make it work.

Took me a while to get this right, this is what I changed:

Locale

Pretty much every one wants this.
I played around, setting the LANG variable to “en_US.UTF8” works, but necessary is even less:
In /etc/env.d/02locale:

LC_CTYPE="en_US.UTF8"

Runk
env-update && source /etc/profile
to activate it and check with
locale
to see if the output is like the one below.

Output of “locale

LANG=
LC_CTYPE=en_US.utf8
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=

X server configuration

Thanks to this blog entry on Shinobu’s Secrets, I finally got this part right. (The commented lines might be necessary for someone else.)
In /etc/X11/xorg.conf.d/30-keyboard.conf:

Section "InputClass"
        Identifier "keyboard-all"
        Option "XkbLayout" "us"
        # Option "XkbModel" "pc105"
        Option "XkbVariant" "altgr-intl"
        # MatchIsKeyboard "on"
EndSection

With the 2 changes above, you should be set. Everything below is nice-to-have.

Keymap setting in /etc/conf.d/keymaps

I leave this to “us” (default) for anything normal since X-server handles it’s own config.

You could use the “us-acentos” keymap, which has deadkeys on ‘^ and the sort, so I can type ‘”‘ and ‘q’ to get an ‘ä’ for example.
This is not as nice as in X with layout “us” variant “altgr-intl”!
The huge downside is the dead key, especially on , so I only use it for emergencies.
Run loadkeys us-acentos and revert with loadkeys us.

You can set this permanent in /etc/conf.d/keymaps like this:

keymap="us-acentos"

One day I’ll compose a console keymap just like “us” variant “altgr-intl”, but don’t hold your breath ;-)

/etc/locale.gen

de_CH ISO-8859-1
de_CH.UTF-8 UTF-8
en_US ISO-8859-1
en_US.UTF-8 UTF-8

Consolefont in /etc/conf.d/consolefont

Recommended for utf-8 is:

consolefont="lat9w-16"

But imho it holds no improvement to the default “default8x16”, the default even displays a few more characters (greek alphabet).

Now if you want something nice, install the terminus-fonts:
emerge -avt media-fonts/terminus-font
and set this to /etc/conf.d/consolefont:

consolefont="Lat2-Terminus16"

It seems to display the same set of characters as “lat9w-16” (less greek symbols then default) but it just looks better.

If you change it, also check if consolefont is started with the system:
rc-update -v show | grep consolefontn
If it is not in any run-level, execute:
rc-update add consolefont boot

Terminal emulator in X (rxvt-unicode)

The terminus font is defined in ~/.Xdefaults with:

! global font
*font:  xft:terminus
*boldFont:  xft:terminus

! rxvt-unicode font
urxvt*font:             xft:terminus:pixelsize=16
urxvt*boldFont:         xft:terminus:pixelsize=16

Easy Configuration In Gnome

When I used Gnome, the keymap was in:
System/Preferences/Keyboard/Layouts : English (US) English (international AltGr dead keys)
It must be at top to be active.

Advertisements

2 comments

  1. Bénoît Segond von Banchet · · Reply

    /quote

    One day I’ll compose a console keymap just like “us” variant “altgr-intl”, but don’t hold your breath ;-)

    /endquote

    Great idea; can I be of help? I really like to have it …

  2. I made one, give it a try and tell me if it lacks anything you want.

    http://tehsuck.de/projects/us-intl-keymap.php

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: