I know that on many Desktop Environments, Using win + Space one can switch between installed language inputs.
Is there a command line way of achieving the same ?
I know that on many Desktop Environments, Using win + Space one can switch between installed language inputs.
Is there a command line way of achieving the same ?
Don't worry, there is a quick solution.
Open a new terminal and execute localectl set-locale LOCALEVAR=LOCALE
to impose a new locale.
Before executing the command, replace "LOCALE" with the desired locale from the output of localectl list-locales
and "LOCALEVAR" with any variable name from the output of locale
.
If you want to change the keyboard input locale of the terminal use localectl set-keymap LANGNAME
; if you want to change the keyboard input locale of the GUI use localectl set-x11-keymap LANGNAME
. Replace "LANGNAME" with the short-name of your language.
Explanation: the console command localectl
is used to change the system locale and keyboard layout settings.
The system locale if for the system services and the GUI; the keyboard settings control the keyboard layout used on the console and of the GUI.
localectl list-keymaps
(in a terminal window on my desktop or in a TTY window) it returns "Couldn't find any console keymaps." setxkbmap
OTOH changes the current layout in terminal/TTY instantly.
– Gunnar Hjalmarsson
Sep 28 '16 at 19:45
setxkbmap
is valid only if the system uses the old X keyboard extension. localectl
is more portable because it uses the native kbd
driver and the change is immediate, but you need to correctly configure your Xorg server.
– Lorenzo Ancora
Sep 28 '16 at 22:58
Trying to help by posting an own answer using the setxkbmap
command.
To switch to English(US):
setxkbmap -layout us
To switch to Kannada:
setxkbmap -layout in -variant kan