1

I have the Ubuntu 18.04 installed. When I open the Settings, then in Keyboard tab click on the shortcut - the app stops responding.

How can I change the keyboard shortcut for Typing (switch to another language) without using the Settings app ?

Aleksey
  • 23

1 Answers1

0

you can get the current key combination for switching the input-source and input-source-backward by running the below command look for the once matching

gsettings list-recursively | grep input-source

Example:

parrot@i7-4770U:~$ gsettings list-recursively | grep input-source
org.gnome.desktop.wm.keybindings switch-input-source ['<Super>space']
org.gnome.desktop.wm.keybindings switch-input-source-backward ['<Shift><Super>space']
ca.desrt.dconf-editor.Settings saved-view '/org/gnome/desktop/input-sources/xkb-options'
org.gnome.desktop.input-sources show-all-sources false
org.gnome.desktop.input-sources xkb-options @as []
org.gnome.desktop.input-sources per-window false
org.gnome.desktop.input-sources current uint32 0
org.gnome.desktop.input-sources mru-sources [('xkb', 'us'), ('xkb', 'de')]
org.gnome.desktop.input-sources sources [('xkb', 'us'), ('xkb', 'de')]
parrot@i7-4770U:~$ 

the above result says Super+space and Shift+Super+space are the ones..

you can put your own keycombinations with the below command but it does not guarantee that the key combo will work..

for example:

gsettings set org.gnome.desktop.wm.keybindings switch-input-source "['<Super>i']"
gsettings set org.gnome.desktop.wm.keybindings switch-input-source-backward "['<Shift><Super>i']"

Edit:

if you want to make Ctrl+Shift as a Shortcut for Switching the Layout you can either use gnome-tweaks like this

enter image description here

But you need to press Shift first and then Control or Control+2 times Shift for the first time..

the commandline way to achieve this is

gsettings set org.gnome.desktop.input-sources xkb-options "['grp:ctrl_shift_toggle']"

again in this way you will loose graphical representation that is not equivealent to changing the input-language via default shortcut Super+Space

PRATAP
  • 22,460
  • After I made the command gsettings set org.gnome.desktop.wm.keybindings switch-input-source "['']" old and new combinations did not work. In Settings GUI it was marked as "Disabled" and there was a X button near it. I pressed that button and old combination was restored – Aleksey May 17 '19 at 04:28
  • try ctrl and any letter combination.. either Ctrl Shift nor Shift Ctrl is not accepting the GUI way.. so it is not possible if you give it via GUI or gsettings.. – PRATAP May 17 '19 at 04:32
  • gsettings set org.gnome.desktop.wm.keybindings switch-input-source "['z']" works ! But I need Ctrl-Shift :-) – Aleksey May 17 '19 at 04:39
  • if you want Control+Shift you can make it via Gnome-Tweaks.. if that does not work.. you need to bind Control+Shift action like this https://askubuntu.com/q/1123163/739431 – PRATAP May 17 '19 at 04:39
  • Currently I followed this way from that link: "1. Install GNOME Tweaks (gnome-tweak-tool) 2. Open the Tweaks app 3. Switch to the Keyboard & Mouse panel 4. Click Additional Layout Options 5. Use the "Switching to another layout" section" It works with 1 sec delay at backward switching – Aleksey May 17 '19 at 05:05