I have the following problem: I use the intl variant of gb keyboard layout, i.e., what you get with:

setxkbmap -layout gb -variant intl

I use gmail in Firefox, and for some reason, the gmail shortcut to move between tabs in the inbox, which is trigged with the key ~, does not work.

The problem comes from having to press ~ and Space afterwards, so 2 keys, to get the symbol (that is the intl variant, which allows me to write ñ, the Spanish letter).

I've tried the us layout with the intl variant, and in that case the shortcut works, because the ~ symbol can be triggered with AltGr + ~.

So, what I want is to have the same behaviour with the gb layout. Or, generally, to map ~ to any other combination (not involving more than one key).


You can use xmodmap to change the mapping of the ~ key.

For example on my system (stock US layout) it is configured by default like this:

$ xev # then pressing Shift + ~
KeyRelease event, serial 36, synthetic NO, [..]
root 0xa3, [..]
state 0x11, keycode 49 (keysym 0x7e, asciitilde), same_screen YES,
XLookupString gives 1 bytes: (7e) "~"
XFilterEvent returns: False

Then I can check out how keycode 49 is exactly configured:

$ xmodmap -pke | grep 'keycode *49'
keycode  49 = grave asciitilde grave asciitilde

You can feed an expression like this back to xmodmap, e.g. with something like this:

$ xmodmap -e 'keycode  49 = grave asciitilde grave asciitilde'
  • Great! Thank you. I used xmodmap -e 'keycode 51 = numbersign dead_tilde numbersign dead_tilde asciitilde asciitilde bar' This way I have ~ with AltGr + ~, and also with AltGr + Shift + ~. – Alejandro DC Sep 17 '13 at 13:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.