I've asked a question about remapping the keyboard by using xmodmap, and I refered a question below and it helped some: How persistently remap keys in Ubuntu 16.04?

but unlike that question, my xmodmap rewinds though I didn't reboot or logged off. Does anyone know why the xmodmap suddenly doesn't work? I can't get the circumstance that makes it back to normal.

For some information about my problem, I need to change Alt_L and ISO_Level3_Shift. So this is my .Xmodmap file:

remove mod1 = Alt_L
remove mod5 = ISO_Level3_Shift
keysym ISO_Level3_Shift = Alt_L
keysym Alt_L = ISO_Level3_Shift   
add mod1 = Alt_L
add mod5 = ISO_Level3_Shift

In sum, I can remap the keyboard by using the .Xmodmap file above, but it rewinds although I didn't reboot.

up vote 0 down vote accepted

If your goal is to change Alt_L and ISO_Level3_Shift, I think this command does what you want:

setxkbmap -option lv3:ralt_alt -option lv3:lalt_switch

If it does, you can make the change persistent for your user via this command:

gsettings set org.gnome.desktop.input-sources xkb-options "['lv3:ralt_alt', 'lv3:lalt_switch']"
  • Thank you. Sadly the first one doesn't work. The second one works well, but it doesn't change it persistently. – J. Victor Jan 26 '17 at 5:10
  • Sorry it works :) – J. Victor Jan 26 '17 at 5:53

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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