Hello. I want to do the following:

  1. Swap caps and ctrl;
  2. Set the switch - Caps to us and Shift + Caps to en
  3. Highlight the Scroll Lock on the English layout.

Here is my config, which I feed xkbcomp:

xkb_keymap { xkb_keycodes { include "evdev+aliases(qwerty)" }; xkb_types { include "complete" }; xkb_compat { include "complete" }; xkb_symbols { // include "pc+us+ru:2+inet(evdev)+group(shift_caps_switch)" replace key <CAPS> { [ Control_L ] }; replace key <LCTL> { [ Caps_Lock ] }; include "pc+us+ru:2+inet(evdev)+group(shift_caps_switch)" }; xkb_geometry { include "pc(pc105)" }; }; 

The trouble is that everything is not given at once - either the buttons change, or the switching of layouts is configured. How to be?

  • the second and third (sub) questions are better to ask separate questions. because they are not related to each other. - aleksandr barakin
  • By the way, on the second (sub) question, I recommend looking at my article “Notes in the margins of the keyboard” and the topic with its discussion . whether in the "notes", or in the comments almost such a setting, like, "ran through." - aleksandr barakin

1 answer 1

Swap caps and lctrl

swap the keycodes for these two keys:

 $ xkbcomp $DISPLAY - | grep -m 2 'LCTL\|CAPS' <LCTL> = 37; <CAPS> = 66; 

and configure everything else based on the fact that the button labeled caps is now <LCTL> , and the left button labeled control is now <CAPS> .


You can change it on the fly, saving the output of the above command to a file:

 $ xkbcomp $DISPLAY файл 

editing it and loading it back with a symmetric command:

 $ xkbcomp файл $DISPLAY 

or "stationary", correcting the file with keycodes . “Find” it is not difficult, based on the information you provide:

 xkb_keycodes { include "evdev+aliases(qwerty)" }; 

The file is called evdev , located (by default) in the /usr/share/X11/xkb/keycodes .

by the way, aliases(qwerty) “decrypted” as: the aliases file (in the same directory), and in it the qwerty section.