I want to configure CapsLock to switch always to the English keyboard layout (input source), while Shift+CapsLock switches always to Russian [18.04]
I've been using the setup described in the title successfully on Linux Mint 15, based on Cinnamon and Ubuntu 16.04.
I just went to keyboard configuration and set up combinations for each keyboard layout (input source).
I've migrated to Ubuntu 18.04 Desktop via a clean install and discovered that I can't do the same. I was gonna use this solution, but in 18.04 the CapsLock key can't be used as a hotkey:
In this dialog, the CapsLock key either does nothing or reveals the Cancel button. The Save button becomes visible only when I press a combination of a modifier and a character key.
So how do I configure CapsLock to switch to English (regardless of how many times it's pressed) and Shift+CapsLock to switch to Russian?
PS: Note that gnome-tweaks
is irrelevant here because it has no per-language configuration options.
Best Answer
Install Gnome Tweaks:
Run Gnome Tweaks: Press the Super (aka Windows) key, type
Tweaks
, press Enter.Go to Keyboard & Mouse section in the left list.
Click the Additional Layout Options button in the main area on the right.
Expand the Caps Lock Behavior section.
Select Make Caps Lock an additional Menu key. This seems to be the only option available to expose Caps Lock as a regular, non-modifier, unused key.
Close both windows.
You can now use Caps Lock in hot keys – both standalone and with modifiers.
As for switching to a specific keyboard layout, the
gsettings set org.gnome.desktop.input-sources current 0
option is deprecated and ignored.This command works: