Since, there is no gnome-shell-extension as of now for the static shifting of keyboard layout using default shortcuts Super+Space and Shift+Super+Space..
and the comments about this link Static ordering of keyboard layout switching in Ubuntu 17.10 and later with GNOME 3 from OP
the problem with the solution proposed in the link (Alt+Shift) is that
it lacks a visual feedback, and can't use shortcut for previous (like
win+shift+space to go back one input). So it's not really satisfying.
I could achieve at least one point out of two (Visual Feedback & Switching back to previous layout) with below workaround.
Workaround
OS: Ubuntu 19.10
Reference: Manipulate the Default Shortcut Super+Space for Switching to Next Input Source without Graphical Representation
Create two scripts with below contents, I have named those as "SuSpace.sh" and "ShSuSpace.sh"
SuSpace.sh
#!/bin/bash
totalLang=$(gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell --method org.gnome.Shell.Eval "imports.ui.status.keyboard.getInputSourceManager()._mruSources.length" | grep -oP "(?<=').*?(?=')")
currentLang=$(gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell --method org.gnome.Shell.Eval "imports.ui.status.keyboard.getInputSourceManager().currentSource.index" | grep -oP "(?<=').*?(?=')")
declare -i math=$currentLang+1
if [ "$math" -lt "$totalLang" ]; then
gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell --method org.gnome.Shell.Eval "imports.ui.status.keyboard.getInputSourceManager().inputSources["$currentLang+1"].activate()"
else
gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell --method org.gnome.Shell.Eval "imports.ui.status.keyboard.getInputSourceManager().inputSources[0].activate()"
fi
ShSuSpace.sh
#!/bin/bash
totalLang=$(gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell --method org.gnome.Shell.Eval "imports.ui.status.keyboard.getInputSourceManager()._mruSources.length" | grep -oP "(?<=').*?(?=')")
currentLang=$(gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell --method org.gnome.Shell.Eval "imports.ui.status.keyboard.getInputSourceManager().currentSource.index" | grep -oP "(?<=').*?(?=')")
declare -i math=$currentLang-1
if [ "$math" -eq -1 ]; then
gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell --method org.gnome.Shell.Eval "imports.ui.status.keyboard.getInputSourceManager().inputSources["$totalLang-1"].activate()"
else
gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell --method org.gnome.Shell.Eval "imports.ui.status.keyboard.getInputSourceManager().inputSources["$currentLang-1"].activate()"
fi
you can create custom shortcuts for these two scripts as per your wish.
localectl
to change the input. But I wish that was a built-in option. again thanks for your help.xbindkeys
thanks for suggestionAlt+Shift
) is that it lacks a visual feedback, and can't use shortcut for previous (likewin+shift+space
to go back one input). So it's not really satisfying. Again I switch often the languages and it's more easy to memorize the location of the current input (highlighted) and move from 1, 2, 3, 4, ... positions. Do you understand ?