71 votes

List all valid kbd layouts, variants and toggle options (to use with setxkbmap)

Take a look at localectl, especially following options: localectl list-x11-keymap-layouts - gives you layouts (~100 on modern systems) localectl list-x11-keymap-variants de gives you variants for ...
Daerdemandt's user avatar
50 votes
Accepted

Gnome 3.22: disable alt+shift keyboard layout switching

Okay, got it: this line in my /etc/default/keyboard XKBOPTIONS="grp:alt_shift_toggle,grp_led:scroll" .. should not contain grp:alt_shift_toggle, which is the relevant xkb option according to this ...
iago-lito's user avatar
  • 2,751
47 votes

Swap alt and super

If you only want to swap left alt and super key execute the command in your terminal: setxkbmap -option altwin:swap_alt_win To restore the default behavior just use: setxkbmap -option Note: This ...
coljamkop's user avatar
  • 591
43 votes
Accepted

Does Wayland use XKB for keyboard layouts?

Yes, Wayland uses XKB for keyboard layouts. But it's not quite the right question, because things work different than in X. Remember that Wayland is only a protocol (plus a wrapper library). At the ...
whot's user avatar
  • 626
26 votes
Accepted

How to allow for caps-lock keyboard layout change

You could set the corresponding xkb option via dconf-editor. Navigate to org > gnome > desktop > input-sources and add grp:caps_toggle to your xkb-options: Note each option is enclosed in single ...
don_crissti's user avatar
  • 82.9k
26 votes

How to allow for caps-lock keyboard layout change

If you're looking for a way to visually edit configuration as in other answer, there's dconf-editor supplied with dconf-tools: sudo aptitude install dconf-tools If you fancy batch editing needed ...
sanmai's user avatar
  • 1,426
25 votes

How to display the current keyboard layout?

From the command line: gkbd-keyboard-display -l <layout>. To see what your installed keyboards are (for example to find the layout code to use in the command above) use setxkbmap -query.
gessel's user avatar
  • 361
19 votes
Accepted

How to create lowercase pi (“π”) with compose key?

as others remark, there are no standard compose rules in X for π, so if you want to use compose to make the π symbol (as I just did), you could: install uim create ~/.XCompose put there the rules you ...
mariotomo's user avatar
  • 2,745
19 votes

How to change keyboard layout in gnome 3 from command line

Since gnome-shell exposes a JS eval interface on DBus which has access to all variables, the feat is possible with the following command: gdbus call --session --dest org.gnome.Shell \ --object-path /...
sanmai's user avatar
  • 1,426
19 votes
Accepted

Changing the keyboard layout/mapping on both the console (tty) and X in an X/console agnostic way?

Yes, there is a way, and this is indeed how Debian's console-setup package does it. Keyboard layouts are specified in XKB terms (model, layout, variant, and options) by the administrator in a file ...
JdeBP's user avatar
  • 68.9k
17 votes

List all valid kbd layouts, variants and toggle options (to use with setxkbmap)

You could retrieve the list in that file /usr/share/X11/xkb/rules/evdev.lst Example to retrieve variants with sed to find only Danish variant sed '/! variant/,/^$/!d;/Danish/!d' < /usr/share/X11/...
Paul's user avatar
  • 301
14 votes

How to add additional keyboard layouts in Manjaro?

Open System Settings, choose "Input Devices", click on "layouts", add any language you want, and see the "alternate shortcut" you can change as you want and when you click the shortcut keys you choose....
Ahmed Abdelnaby's user avatar
14 votes
Accepted

What files does the Gnome Tweak Tool act on (when changing the Typing settings)?

The files altered by gnome-tweak-tool are ~/.config/dconf/user (this is the dconf database, a binary file where most user settings are stored) and various other configuration files under ~/.config (...
don_crissti's user avatar
  • 82.9k
14 votes
Accepted

What does "level" of a key mean in keyboard settings?

Level 1: no modifications (e.g. pure a) Level 2: usually Shift (e.g. shift+a -> A, so the character A is level 2 of the a-key) Level 3: usually AltGr (e.g. AltGr+a -> æ, so character æ is level ...
FelixJN's user avatar
  • 13.6k
13 votes

On an Apple Keyboard under Linux, how do I make the Function keys work without the fn modifier key?

For anyone stumbling upon this thread using one of the newer MacBook Pros (2016 and later) which need the applespi driver to make the keyboard and touchpad work, here's how to make this work, as I ...
Misha's user avatar
  • 131
13 votes
Accepted

How can one create a custom keyboard layout for Linux?

You can edit keymaps with XKeyCaps. On the upside, XKeyCaps is a GUI and it's very mature. A downside of XKeyCaps is that it's only a front-end to the old-style X window keymap interface, xmodmap, and ...
Gilles 'SO- stop being evil''s user avatar
11 votes

Use setxkbmap to swap the Left Shift and Left Control

I ran into some issues mapping LALT to Control_L using Pablo's solution, it appears you need to set the modifier_map options as well. I copied a template from /usr/share/X11/xkb/symbols/altwin - ...
Jo-el's user avatar
  • 211
10 votes

How to display the current keyboard layout?

Selecting the current layout with gkbd-keyboard-display is possible like so: #! /usr/bin/env fish set layout (setxkbmap -query | grep layout | tr -s ' ' | cut -d ' ' -f2) set variant (setxkbmap -...
Raphael's user avatar
  • 2,075
10 votes

List all valid kbd layouts, variants and toggle options (to use with setxkbmap)

Options with descriptions An alternative to localectl list-* is to to search the file /usr/share/X11/xkb/base.lst, which contains the same lists, but with descriptions as well. Example aliases: alias ...
pyrocrasty's user avatar
10 votes
Accepted

How to remap keyboard keys based on how long you hold the key

I just wrote this in C: #include <stdio.h> #include <curses.h> #include <time.h> //time(0) #include <sys/time.h> // gettimeofday() #include <stdlib.h> ...
林果皞's user avatar
  • 5,156
10 votes
Accepted

Unable to simulate Ctrl+Shift+Fn+F10 Key press \

You do not need to. On my notebook I need to press the button Fn before F10. That is, however, irrelevant to what X input events you need to simulate. What you have to remember is that the Fn key is ...
JdeBP's user avatar
  • 68.9k
9 votes
Accepted

How To Reload xserver After a Change in Keyboard Layout?

From here: To apply new [keyboard] settings, restarting the keyboard-setup service should suffice, otherwise you can try to restart kernel input system via udev: udevadm trigger --subsystem-match=...
Chris Hunt's user avatar
9 votes
Accepted

What is VC keymap?

The VC is the virtual console which is also known as a virtual terminal VT. It is the full screen tty you might see before X11 launches (or switch to with Ctrl+Alt+2). It has its own keymap ...
meuh's user avatar
  • 51.5k
9 votes
Accepted

Mapping scancodes to keycodes

The keycodes are numerically different: The X keycode value is derived by adding 8 (the value of MIN_KEYCODE) to the Linux input layer keycode, as you can see in the source of evdev.c, line 280. Apart ...
dirkt's user avatar
  • 32.4k
9 votes

Keyboard Layout with Sway on Fedora (Wayland)

In newer versions of sway you can simple put the following lines in your config file: input * xkb_layout "de" # German keyboard layout input * xkb_options "caps:escape" # Make Caps Lock an additional ...
Devon's user avatar
  • 922
8 votes
Accepted

How to reverse ESC and CAPS_LOCK on TTY

First You Need To install "console-data" sudo apt-get install console-data Now use "sudo showkey" to find the keycode of your ESC and CapsLock key sudo showkey My keycode for ESC was "1" and for ...
Brendan Threewitt's user avatar
8 votes

How do I temporarily switch between keyboards on KDE Plasma 5?

In KDE5 Plasma go to System Settings and select Hardware / Input devices. Then select Keyboard / Layouts. Add Arabic Buckwalter (this layout is easy for non-Arabic speaking people). At that screen ...
Cie6ohpa's user avatar
  • 243
8 votes

How to make a ISO_Level4_Shift and Lock in xkb?

It's possible but a bit hacky. No specific keysyms are already defined. ISO_Level3_{Shift,Latch,Lock} (and the same three for level5) are defined in X11 and libxkbcommon headers at compile time. At ...
quixotic's user avatar
  • 1,140

Only top scored, non community-wiki answers of a minimum length are eligible