LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 01-20-2021, 06:38 AM   #1
shams
Member
 
Registered: Jan 2004
Posts: 539

Rep: Reputation: 30
How to change between three kyboard layouts with keys?


I am writing some article and use three keyboard layouts English, pashto and persian and i use the gedit in arch linux, i want to use key combinations to switch between these three layouts for speed of work, after search i come to use setxkbmap for this purpose, when i run the command:
Code:
sudo setxkbmap -layout af
it cannot change the keyboard layout for the gedit and libreoffice writer and can change for firefox, arch Text Editor and brackets.
How to change the layout for all applications?
 
Old 01-20-2021, 07:29 AM   #2
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,706

Rep: Reputation: Disabled
localectl, perhaps? See Xorg/Keyboard configuration in ArchWiki.
 
Old 01-20-2021, 08:18 AM   #3
shams
Member
 
Registered: Jan 2004
Posts: 539

Original Poster
Rep: Reputation: 30
I read the article and first run this command:
Code:
setxkbmap -layout us,af,ir -option grp:alt_shift_toggle
The command create the file /etc/X11/xorg.conf.d/00-keyboard.conf:
Code:
# instruct systemd-localed to update it.
Section "InputClass"
        Identifier "system-keyboard"
        MatchIsKeyboard "on"
        Option "XkbLayout" "us,af,ir"
        Option "XkbModel" "grp:alt_shift_toggle"
EndSection
But cannot change the keyboard layout to any of them with the alt+shift, then use this command:
Code:
sudo localectl --no-convert set-x11-keymap us,af,ir grp:alt_shift_toggle
Also did not work.
 
Old 01-20-2021, 11:07 AM   #4
lvm_
Senior Member
 
Registered: Jul 2020
Posts: 1,516

Rep: Reputation: 516Reputation: 516Reputation: 516Reputation: 516Reputation: 516Reputation: 516
Never had to use multiple keyboard layouts without a GUI and so don't know how to set it up via command line, but it definitely can be done via GUI setup e.g. in KDE open settings, go to hadrware-input devices-keyboard-layouts, click on 'shortcut' beside each of the layouts and pick one.
 
Old 01-20-2021, 11:14 AM   #5
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Salix
Posts: 6,243

Rep: Reputation: 2364Reputation: 2364Reputation: 2364Reputation: 2364Reputation: 2364Reputation: 2364Reputation: 2364Reputation: 2364Reputation: 2364Reputation: 2364Reputation: 2364
Why do you want to use the command line when you have a GUI? You can have a button on the panel for selecting the layout and indicating the current one; some desktops create that automatically if you set up your keyboards with their configuration tool. That tool will also allow you to nominate a group-shift key to toggle drivers — I use Scroll Lock. You can also decide what switching keyboards does — global change, change in the current application, or change in the currently active screen. I too have three drivers, but I leave it to Xfce to do the donkey work — that's what GUIs are for.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Missing keys in keyoboard layouts litzel Linux - Newbie 2 05-26-2013 10:53 AM
wireless kyboard in Mandrake/Mandriva 2006 yoron Linux - Newbie 0 11-09-2005 02:22 PM
switching between keyboard layouts trawler Linux - Software 1 10-22-2005 06:51 AM
Switching between keyboard layouts ??? GloVe Linux - General 1 10-13-2003 10:26 AM
Modifier keys + non-latin keyboard layouts angryziber Linux - Hardware 0 10-08-2003 02:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 12:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration