I have an Apple Aluminium keyboard. To the left of 1 key I have the less/greater (< >) key, not grave/tilde (` ~).
xmodmap
does not work for me: layout switching (done with setxkbmap
) resets my xmodmap changes. .Xmodmap
file does not help either.
How do I remap the tilde key?
Best Answer
xmodmap Way
First, check this out.
Here's my version of
.xsession
:and the corresponding
~/.Xmodmap-Apple
(for the Russian version):setxkbmap way
In Linux,
setxkbmap
is used to switch keyboard layouts. Alas,setxkbmap
&xmodmap
can't work together: they reset each other's changes :( You'll have to pick one of:xmodmap
after every layout switching (or make a script replacingsetxkbmap
)xkb
key mappings for your keyboard.We'll use the latter. First, check which layout you're using:
Here's your symbols map:
xkb_symbols ... macintosh_vndr/apple(alupckeys)
In Ubuntu, we have a mapping for apple keyboards here: '/usr/share/X11/xkb/symbols/macintosh_vndr/apple'. First, backup this file. This file has several sections, each starts like this:
The latter mapping,
"alupckeys"
, replaces F13-F15 with PrintScreen, ScrollLock, Pause. Use it if you lack these keys :)Choose the section you've got from the command output above, and append the following, before the final
}
of the section:Now, restart X. Yeehaw, enjoy having the tilde key on the correct place :)
This command can also help: