Supporting the Euro (€) sign under X Windows

My Thinkpad X22 has a € stuck to the 4 key. To support it under X Windows we need to tweak a few things.
Use fonts that contain a €
For example, I have an X resource
xterm*font: -misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-iso8859-15
Any font that ends with iso8859-15 will have the requisite glyph.
Set the keyboard to generate the correct code
The € is meant to be accessed by using the AltGr key, just like another shift key: AltGr-4. By default, the keyboard is probably set up to produce a ¼ for this combination. Look in /etc/X11/XF86Config-4 for your keyboard layout. I have
        Option  "XkbLayout"     "gb"
        Option  "XkbVariant"    "basic"
We need to change /usr/X11R6/lib/X11/xkb/symbols/gb. I added a new keyboard variant:
partial alphanumeric_keys 
xkb_symbols "euro" {

    // Describes the differences between a very simple en_US
    // keyboard and a very simple U.K. keyboard layout defined by
    // the SVR4 European Language Supplement and sometimes also
    // known as the IBM 166 layout.
    // with Euro RJB

    name[Group1]= "Great Britain";

    key <TLDE> {        [           grave,         notsign      ],
                        [             bar,             bar      ]       };
    key <LSGT> {        [       backslash,             bar      ],
                        [             bar,       brokenbar      ]       };
    key <AE02> {        [               2,        quotedbl      ]       };
    key <AE03> {        [               3,        sterling      ]       };
    key <AE04> {        [               4,          dollar      ],
                        [        currency,            cent      ]       };
    key <AC11> {        [      apostrophe,              at      ]       };
    key <BKSL> {        [      numbersign,      asciitilde      ]       };

    // End alphanumeric section
    
    // begin modifier mappings
    
    modifier_map Shift  { Shift_L };
    modifier_map Lock   { Caps_Lock };
    modifier_map Control{ Control_L };
    modifier_map Mod3   { Mode_switch };
};
The new part being the key <AE04> section. This defines the 4 key to produce 4, $, , ¢ for plain key, shift, AltGr, shift-AltGr respectively.

Next change /etc/X11/XF86Config-4:

        Option  "XkbLayout"     "gb"
#       Option  "XkbVariant"    "basic"
        Option  "XkbVariant"    "euro"
to use the new variant.

Restart X Windows, and that should do it!

Some keyboards have the € sign on the E key. This is much the same as the above, except we need a <AD04> rather than <AE04> (or whatever is needed for wherever your E lives).

Russell Bradford, April 2002.