Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
7
rated 0 times [  7] [ 0]  / answers: 1 / hits: 16932  / 3 Years ago, thu, may 13, 2021, 6:40:14

By default, no layout on my Macbook Air allows me to print backtick (`) and tilde (~) symbols. Instead, I get backslash, pipe or whatever, depending from the layout.



I changed the behavior of the key that I want to use to print tilde using the following commands:



xev
<press tilde button>
keycode <keycode from xev output> = grave asciitilde >~/.Xmodmap
xmodmap ~/.xmodmaprc


(instructions are based on these https://stackoverflow.com/questions/17757232/switch-tab-and-backtick-keys-ubuntu-linux)



But unfortunately, after I switch the layout, I get the default behavior again.



How to make these changes permanent?


More From » 14.04

 Answers
4

Okay, I solved the problem.



First off, xmodmaprc doesn't work in Ubuntu 14.04.
The solution is to edit xkb (X KeyBoard extension) config files.



Find the file /usr/share/X11/xkb/symbols/pc, backup it, then open and comment out the line:



key <LSGT> {    [ less, greater, bar, brokenbar ] };


And on the next line, add the following:



key <LSGT> { [ grave, asciitilde, grave, asciitilde ] };


If you need to change configuration for another locale, check the folder /usr/share/X11/xkb/symbols/ and find the file corresponding to the locale you want to change.



To apply the changes, you have to remove all xkb cache files:



rm -rf /var/lib/xkb/*

[#23001] Thursday, May 13, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
izeeas

Total Points: 412
Total Questions: 105
Total Answers: 118

Location: Trinidad and Tobago
Member since Fri, May 8, 2020
4 Years ago
;