1

I wanted to have two keyboard layouts (one for english and one for spanish), and add a shortcut for switching between them.

The solution I chose was to set the following lines in my /etc/default/keyboard file:

XKBLAYOUT="us,es"
XKBOPTION="grp:ctrl_shift_toggle"

This has turned out to be a mistake because the ctrl_shift shortcut interfers and takes precedence over all other application level shortcuts like browser's ctrl+shift+tab and vi's ctrl+shift+insert.

I haven't found a way to revert this change and have it persist in between shutdowns.

Here are the methods I have tried: 1) Removing the XKBOPTION line from /etc/default/keyboard 2) Running the command dpkg-reconfigure keyboard 3) Running the command setxkbmap -option. This works but is reset upon restarting. 4) Configuring one single layout by adding the line XKBLAYOUT and adding the alternative layout via GNOME and using the GNOME shortcut (Super space). The switch has no effect and is reset upon restarting.

I don't know where these changes are stored in between installs, I have ran grep with searching for terms like XKBOPTION,ctrl_shift_toggle but I can't seem to find it. All I can find is that the setxkbmap -print command shows the ctrl_shift_toggle option:

xkb_keymap {
    xkb_keycodes  { include "evdev+aliases(qwerty)" };
    xkb_types     { include "complete"  };
    xkb_compat    { include "complete"  };
    xkb_symbols   { include "pc+us+es:2+us:3+inet(evdev)+grp(ctrl_shift_toggle)"    };
    xkb_geometry  { include "pc(pc105)" };
};

However, as mentioned, I cannot find the file responsible for the ctrl_shift_toggle configuration.

Note: The question is looking for an answer that can revert the state of the keyboard setting either to the original setting, or to the desired configuration. Reinstalling the OS or a solution that starts from a clean install is not considered an optimal solution. The reason for this is that, as a superuser, I want to have deep control of my system.

Thank you for your time.

3
  • There is the possibility that I A) have a bug specific to my configuration or B) modified another setting through a file or command that I can't remember. So I would appreciate if someone with guts could try to reproduce this bug in their computer, or if someone with time/virtual machine skills could try it in a discardable sandbox. I expect this bug to occur in a clean Ubuntu 18.04 machine. Thank you!
    – TZubiri
    Apr 24, 2019 at 21:03
  • I still have this problem after 5 months. Maybe it's time to reinstall the whole OS, or even better, change OS
    – TZubiri
    Sep 24, 2019 at 22:42
  • Does trhis solution work for you?
    – harrymc
    Sep 25, 2019 at 6:44

1 Answer 1

0

Run setxkbmap -option on startup every time. Adding the line to rc.local doesn't work for some reason.

This solution doesn't undo the original configuration, but rather overwrites it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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