I want my ß, é, ä, ø, æ, þ, ċ, ġ, ƿ, ū, and ȳ
February 11, 2008 10:37 AM Subscribe
Adapting the "US-Extended" or "US-Academic" keyboard layout to Linux on a standard PC keyboard (well, laptop variant): is it feasible?
I am currently running an iBook G4 (dualbooting OS X and Xubuntu) that is on its last legs (the famed faulty logic board and temporary c-clamp fix, though I'll probably go further). Thus, in the next seven months or so, I'll be buying a new computer. I am very interested in buying a PC laptop so that I have that extra pressure to migrate fully to Linux.
The only feature that the Mac has that is a definite professional/academic advantage for me is its wonderful concept of using the compose key (alt/option in OS X) to type non-US characters as opposed to dead keys (the professional/academic advantage is that I'm slowly progressing through the fields of Medieval Studies and German), along with its large collection of easily accessible characters. I particularly want the ability to type eths, thorns, ashes, macrons, umlauts and "scharfes S" quickly. I'd like to do this in Linux just as quickly as I do it in Mac OS X. The distributions I'd use would either be Ubuntu or Xubuntu, thus either Gnome or XFCE desktop environments.
The most helpful information I've found so far has been this, but what I want is to set up a keyboard layout that is really a direct port of either of the two layouts I mentioned above (though preferably US-Extended), although I'm not picky about what key is the compose key (AltGr is fine, though it would be great if I could get the Windows key [meta key] to do this). Strangely, it seems that this desire has been rather rare, although I may have simply used the wrong search strings (I found the creator of US-Academic wondering about it a few years ago). It's not really, in my opinion, a particularly "Mac thing", but simply an intuitive way to compose a lot of characters I need. It's most important that it function in OpenOffice, but covering as much of the Linux desktop as possible. I realize I'll probably have to edit various config and layout files, but is this a feasible, if tedious, undertaking?
(I'll probably post a similar request on Ubuntuforums later, but I hope some metafilter people have some good ideas)
I am currently running an iBook G4 (dualbooting OS X and Xubuntu) that is on its last legs (the famed faulty logic board and temporary c-clamp fix, though I'll probably go further). Thus, in the next seven months or so, I'll be buying a new computer. I am very interested in buying a PC laptop so that I have that extra pressure to migrate fully to Linux.
The only feature that the Mac has that is a definite professional/academic advantage for me is its wonderful concept of using the compose key (alt/option in OS X) to type non-US characters as opposed to dead keys (the professional/academic advantage is that I'm slowly progressing through the fields of Medieval Studies and German), along with its large collection of easily accessible characters. I particularly want the ability to type eths, thorns, ashes, macrons, umlauts and "scharfes S" quickly. I'd like to do this in Linux just as quickly as I do it in Mac OS X. The distributions I'd use would either be Ubuntu or Xubuntu, thus either Gnome or XFCE desktop environments.
The most helpful information I've found so far has been this, but what I want is to set up a keyboard layout that is really a direct port of either of the two layouts I mentioned above (though preferably US-Extended), although I'm not picky about what key is the compose key (AltGr is fine, though it would be great if I could get the Windows key [meta key] to do this). Strangely, it seems that this desire has been rather rare, although I may have simply used the wrong search strings (I found the creator of US-Academic wondering about it a few years ago). It's not really, in my opinion, a particularly "Mac thing", but simply an intuitive way to compose a lot of characters I need. It's most important that it function in OpenOffice, but covering as much of the Linux desktop as possible. I realize I'll probably have to edit various config and layout files, but is this a feasible, if tedious, undertaking?
(I'll probably post a similar request on Ubuntuforums later, but I hope some metafilter people have some good ideas)
On my keyboard, executing
xmodmap -e "keycode 113 = Multi_key"
makes the right Alt key (sometimes labeled AltGr on european keyboards) into a compose key. After doing that, typing "Right-Alt, o, e" gives me: œ. I can also type ß, é, ä, þ, ċ, ġ, ū that way, but for compose y - I get ¥ not ȳ -- I think that's where O'Donnell's advice about ~/.Xcompose enters the picture.
The Ubuntu desktop environment may have some way to automatically do this at login time, but I am not familiar with that aspect of Ubuntu--I still use late-90s style ~/.xsession to run everything when I log in. Now that I read a bit further, I guess he also advices which Settings item can be used to make the setting I did above with xmodmap.
posted by jepler at 11:16 AM on February 11, 2008
xmodmap -e "keycode 113 = Multi_key"
makes the right Alt key (sometimes labeled AltGr on european keyboards) into a compose key. After doing that, typing "Right-Alt, o, e" gives me: œ. I can also type ß, é, ä, þ, ċ, ġ, ū that way, but for compose y - I get ¥ not ȳ -- I think that's where O'Donnell's advice about ~/.Xcompose enters the picture.
The Ubuntu desktop environment may have some way to automatically do this at login time, but I am not familiar with that aspect of Ubuntu--I still use late-90s style ~/.xsession to run everything when I log in. Now that I read a bit further, I guess he also advices which Settings item can be used to make the setting I did above with xmodmap.
posted by jepler at 11:16 AM on February 11, 2008
Response by poster: I'd seen the compose keys, but I think I'd thought they were only available in conjunction with dead keys. As long as I can just use the compose key, that'd probably be the most realistic way to go, and probably what I'll end up using. Thanks, zsazsa and jepler!
posted by Gnatcho at 11:32 AM on February 11, 2008
posted by Gnatcho at 11:32 AM on February 11, 2008
If I read the US Extended doc right, you get most of your extended keyboard codes through:
metakey-sequence alphabetic-key
and combining diacritics through:
alphabetic-key metakey-sequence
The basic ways X facilitates to get characters not on the keyboard are:
map a key to Mode_switch and use Xmodmap to associate Mode_switch-combinations to particular characters
dead keys
compose key sequences, as described above.
The xkb X keyboard extension, standard in Ubuntu and probably most modern Linuxes, but underrepresented in a lot of keyboard modification descriptions, which still dwell on X level stuff allows you to define multiple keyboard layouts and defining a key to do an ISO level shift (by default in Ubuntu, the right alt is ISO level 3 shift) to get to the keys in the other mapping. Web search on 'xkb' to learn about this.
You could define mode_switch-combinations to be dead keys and mimic the metakey-sequence alphabetic-key behavior. I just tried this:
xmodmap -e 'keysym q = q Q dead_acute '
I already have mode_switch mapped to a key. Then 'mode_switch-q a' gave me an á.
I can't think of any good way to duplicate the alphabetic-key meta-sequence for diacritics behavior.
And I don't know of any existing keyboard layouts for these. Surprises me.
posted by Zed_Lopez at 12:12 PM on February 11, 2008
metakey-sequence alphabetic-key
and combining diacritics through:
alphabetic-key metakey-sequence
The basic ways X facilitates to get characters not on the keyboard are:
map a key to Mode_switch and use Xmodmap to associate Mode_switch-combinations to particular characters
dead keys
compose key sequences, as described above.
The xkb X keyboard extension, standard in Ubuntu and probably most modern Linuxes, but underrepresented in a lot of keyboard modification descriptions, which still dwell on X level stuff allows you to define multiple keyboard layouts and defining a key to do an ISO level shift (by default in Ubuntu, the right alt is ISO level 3 shift) to get to the keys in the other mapping. Web search on 'xkb' to learn about this.
You could define mode_switch-combinations to be dead keys and mimic the metakey-sequence alphabetic-key behavior. I just tried this:
xmodmap -e 'keysym q = q Q dead_acute '
I already have mode_switch mapped to a key. Then 'mode_switch-q a' gave me an á.
I can't think of any good way to duplicate the alphabetic-key meta-sequence for diacritics behavior.
And I don't know of any existing keyboard layouts for these. Surprises me.
posted by Zed_Lopez at 12:12 PM on February 11, 2008
Response by poster: and combining diacritics through:
alphabetic-key metakey-sequence
Not sure if I'm understanding you here, but the metakey/compose key still comes first here (the alt/option key on Mac keyboards)...well, actually, at the same time as a key signifying a diacritic, and then you choose the letter that diacritic should be used on (in OS X it actually marks the area where the character will be with yellow and the diacritic before you choose the letter the diacritic should apply to, as an interface help)
posted by Gnatcho at 12:21 PM on February 11, 2008
alphabetic-key metakey-sequence
Not sure if I'm understanding you here, but the metakey/compose key still comes first here (the alt/option key on Mac keyboards)...well, actually, at the same time as a key signifying a diacritic, and then you choose the letter that diacritic should be used on (in OS X it actually marks the area where the character will be with yellow and the diacritic before you choose the letter the diacritic should apply to, as an interface help)
posted by Gnatcho at 12:21 PM on February 11, 2008
ack. Paragraph got mangled in editing up there -- make that "The xkb X keyboard extension, is standard in Ubuntu and probably most modern Linuxes, but underrepresented in a lot of keyboard modification descriptions, which still dwell on X level stuff. It allows you to define multiple keyboard layouts and to define a key to do an ISO level shift (by default in Ubuntu, the right alt is ISO level 3 shift) to get to the keys in the other mapping. Web search on 'xkb' to learn about this."
If the alt/option key always comes first, then the mode_switch-combinations mapping to dead keys should get you all you want.
If you put this in ~/.Xmodmap
Follow the directions in
posted by Zed_Lopez at 2:16 PM on February 11, 2008
If the alt/option key always comes first, then the mode_switch-combinations mapping to dead keys should get you all you want.
If you put this in ~/.Xmodmap
clear mod3 keysym Super_L = Mode_switch keysym 6 = 6 asciicircum dead_circumflex # [etc.]and
$ xmodmap .XmodmapYou can get the names you need from /usr/include/X11/keysymdef.h
Follow the directions in
man xsessionand put the example script given there into /etc/X11/Xsession.d/40x11-custom_load-xmodmap and it'll be loaded every time you start X.
posted by Zed_Lopez at 2:16 PM on February 11, 2008
Response by poster: Since this question isn't likely to get more answers, I'd just like thank everyone for their answers. I'd mark 'em all as best, but that'd look silly.
posted by Gnatcho at 10:40 AM on February 12, 2008
posted by Gnatcho at 10:40 AM on February 12, 2008
This thread is closed to new comments.
posted by zsazsa at 11:15 AM on February 11, 2008