0

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.

Kaz Wolfe
  • 34,122
  • 21
  • 114
  • 172

1 Answers1

1

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']"
Gunnar Hjalmarsson
  • 33,540
  • 3
  • 64
  • 94