It’s easy to make accented characters (e.g. é and ü) in Linux. Easier than in Windows, actually, because in Windows you have to remember all those crazy Alt codes, and in Linux, it’s logical combinations of accents and letters.
- You need a command-line program called
xmodmap. If you’re not sure you have this, run the following command in a term/console:which xmodmap. You’ll probably get something like the following:
sarah@imp:~$ which xmodmap
/usr/bin/X11/xmodmap
This shows that you havexmodmapinstalled, and it happens to be located at /usr/bin/X11/xmodmap. Peachy. - Run the following command in a term:
xmodmap -e "keysym Alt_R = Multi_key"
This assigns your right Alt to be your “multi-key.” Your multi-key is the key you’ll press to tell the computer you’re about to make an accented character. - Now you’re all set! The basic idea is to hit a key sequence, beginning with your multi-key, and then two characters you wish to combine. For example, to make an é, you would hit Alt ' e. That’s right-Alt, release, apostrophe, release, e. Or, you can hold down all the keys at once (i.e. right-Alt + apostrophe + e). You can also produce é if you hit the e before the apostrophe, as long as you begin the sequence with your multi-key.
Note that your term might not recognize the accented characters, and so you should probably do your testing in some place like a browser or text editor.
Voilà. Now you can type your French papers much more quickly, because you won’t have to select individual characters from some symbol chart in your word processor, and you can correspond with your German friends on gaim just as quickly, because you won’t have to copy and paste accented characters from some site.
A note: if you like writing your documents in OpenOffice, you may have some trouble with entering accented characters because OpenOffice always seemed to ignore the Alt key sequences, at least for me with version 1.1.0. I recommend instead, if you’re going to be writing something that involves non-English characters, a word processor called AbiWord. It’s simpler than OpenOffice and it lets you type in the accented characters.
Sample Key Combinations
For these sample sequences, I assume that your multi-key is Alt.
| Combination | Result |
|---|---|
| Alt s s | ß |
| Alt ? ? | ¿ |
| Alt ! ! | ¡ |
| Alt ` o (that’s a back tick) | ò |
| Alt ^ a | â |
| Alt " u (those are quotes, not two apostrophes) | ü |
I’Ve got one problem regarding this… I assigned my left alt key to do this, as you know, but upon rebooting my computer, the left alt doesn’t work in that way anymore. Shouldn’t assigning this key mean it STAYS assigned? I shouldn’t have to reassign it ever time I reboot, should I?
Actually… Yes, that’s the way it works. You can put the
xmodmapcommand in a script that gets executed every time you reboot back into Linux. For example, my window manager IceWM has a “startup” file that is executed as soon as I load IceWM. Or, a ghetto solution if you don’t mind receiving an error message every time you open a term, is to put the command in a file called.bashrcin your home directory. Assuming you use bash as your shell, and not something like csh or zsh. To test and see which shell you use, do the commandecho $SHELLin a term.Thanks! I am using bash, so I’ll just throw that command in a file and deal with the error for now :D
Man, that rhymes!
I know this is kinda late, but an easy way to get this to work at startup (in Ubuntu at least) is to do a
sudo nano /etc/init.d/bootmisc.shand insert the xmodmap command that you use at the bottom of the file (but before the: exit 0line, be sure of that ;)), save it, reboot, and it still works! Far easier than doing .bashrc editing, IMO. :DI’ve actually put this in my ~/.bash_profile which is only run on invoking non-interactive sessions (e.g. logging in). So it won’t be run every time you open a terminal. I think some distros handle this differently, but this is the gist.
Also, to avoid the error printing, just add ‘&> /dev/null’ to the end. Be warned, though; this will not print anything, even something that may be useful. So only add it after you’re sure it’s working as it should.
But let me say, ït îs for me! :)
Have a look at:
http://www.pixelbeat.org/docs/xkeyboard/
Hello from Belgium !
i am a Ubuntu newbie and have a Qwerty
Keyboard ,choose Dutch as Keyboard layout
but @ doesnot show up .Copy and pasting it does work, but thats not the way….
Thanks
Use the Windows key instead of Alt It works in OOo and you aren’t using it for anything else anyway.
Just add the special character applet to the taskbar. Lol.
Not all people are using window managers that have taskbars, or that offer such features. I know for a long time I used Blackbox due to its simplicity, and I never found a ‘special character applet’ that I could’ve put on my taskbar. Before that was fvwm2, which didn’t even have a taskbar in my setup.
Hi! Thanks a lot for your tip! Just the line i’m going to add to my ion3 scripts :-)
I find the best key to use with this is the right Windows key. This, for anyone who doesn’t know, is Super_R.