HOWTO: Enable Portuguese Keyboard Layout in Apple X11 Beta

Introduction

The Apple XWindows Beta for Mac OS X, despite being less obviously configurable than XDarwin or OrobourosX, can be configured to use international keyboard layouts. This HOWTO covers Portuguese, but any keyboard layout from /System/Library/Keyboards can be used.

So far, I don't know how to make these changes "cleanly" persistent (i.e., within standard Mac OS X preference files), but here's how to get up and running:

Commands:

Start X11.app from Terminal using:

/Applications/X11.app/Contents/MacOS/X11 -keymap /System/Library/Keyboards/Portugues.keymapping

Then, if you have an iBook like me, you might want to enable the Option key with:

xmodmap -e 'keycode 66 = Mode_switch' (or add this entry to .Xmodmap)

Notes:

X11.app respects /.xinitrc files, and quartz-wm seems to use X resources (unconfirmed).