Xmodmap: Six characters to one key?
Put lines like the following in your ~/.Xmodmap
:
keycode 0x2D = k K U03BA U039A U0915 U05DB U0137 U0136
The keycode can be obtained by running xev
and pressing the key. If you're starting from a known state, for example, a US keyboard layout, you can use the keysym already assigned to the key, as in
keycode k = k K U03BA U039A U0915 U05DB U0137 U0136
The 8 columns on the right of the =
sign successively correspond to the bare key, Shift, AltGr, AltGr+Shift, and repeat these four with ISO_Level3_Shift as well.
The words on the right of the =
sign are keysyms. You can find valid keysym names in /usr/include/X11/keysymdef.h
(or wherever your distribution puts keysymdef.h
); look for lines of the form #define XK_foo 0xabcd /* ... */
: foo
is the keysym name. You can also use U1234 where 1234
is the number of a unicode character in hexadecimal (for “exotic” characters like क
, that's often the only option).
Final warning: there are two ways to configure the keyboard under X. Xmodmap is the simple way. Xkb is another way; it's more powerful, a lot more complex, and less well documented. Sometimes xkb settings can prevent xmodmap settings from working: the xkb configuration can affect what modifiers the xmodmap columns correspond to.