The keys
The keys you are looking for are:
for editing the input sources:
org.gnome.desktop.input-sources sources
for editing the keyboard shortcut for switching languages forward:
org.gnome.desktop.wm.keybindings switch-input-source
for switching input source backward:
org.gnome.desktop.wm.keybindings switch-input-source-backward
The commands to edit the settings
Example commands to edit the three from command line:
For editing the input sources, to set the input sources as mentioned in your question:
gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'us'), ('xkb', 'it'), ('xkb', 'de')]"
to set the switch- shortcut key combination to Ctrl+space
gsettings set org.gnome.desktop.wm.keybindings switch-input-source "['<Primary>space']"
to set the switch- shortcut key combination to switch backward Shift+Super+space
gsettings set org.gnome.desktop.wm.keybindings switch-input-source-backward "['<Shift><Super>space']"
The commands to get the current settings
gsettings get org.gnome.desktop.input-sources sources
gsettings get org.gnome.desktop.wm.keybindings switch-input-source
gsettings get org.gnome.desktop.wm.keybindings switch-input-source-backward
How to find these keys
You can search for keywords in the database by listing all keys with the command:
gsettings list-recursively
which will list all existing keys, or (which I regularly do) install dconf-editor
and simply find your keyword(s) with Ctrl+F.
Edit
As requested in a comment, I added a small script to walk through the input sources from command line:
#!/usr/bin/env python3
import subprocess
import sys
src = sys.argv[1]
key = "org.gnome.desktop.input-sources"
get = lambda cmd: subprocess.check_output(["/bin/bash", "-c", cmd]).decode("utf-8").strip()
src_list = len(eval(get("gsettings get "+key+" sources")))-1
current = int(get("gsettings get "+key+" current").split()[-1])
if src == "+":
set_new_value = "gsettings set "+key+" current "+(str(current+1) if current < src_list else "0")
elif src == "-":
set_new_value = "gsettings set "+key+" current "+(str(current-1) if current > 0 else str(src_list))
subprocess.Popen(["/bin/bash","-c", set_new_value])
To run it
- Save the script, into an empty file, as
switch_source.py
Run it by the command:
python3 /path/to/switch_source.py +
to go to the next input source, and
python3 /path/to/switch_source.py -
to go to the previous one