Boosts your performance mapping useful keys within reach
This repository stores a custom keyboard layout created for mapping useful keys (such as arrows keys, home keys, etc.) to alphanumeric keys without modifying the usual keyboard behavior. This is done through XKB configuration.
CAPS
key.xkb
in your home directory:git clone ... ${HOME}/.xkb
cd ~/.xkb
. install.sh
. restore.sh
The basic steps (in a somehow hacked way, but it works!) are:
types
Define the new key type with all the possible shift levels.
This allows us to exploit previously unused shift levels,
so that more symbols can be mapped into certain keys.
Put them into a new types file. In our case this file is types/levelFn
.
symbols
Set the custom modifier keys, especially if any unusual shift level is going to be used,
in which case this is probably not previously linked to any key, as in symbols/levelFn
.
Then, customize the symbols mapped to each key, in our case in symbols/customLayer
.
Create the input keymap for the xkbcomp application.
Print the current default keymap with
setxkbmap -print > ~/.xkb/keymap/xkbbase
Edit the fields in this keymap to add the new functionalities.
In our case the new type with +levelFn
and the new symbols with +customLayer(Fn)
.
We store this custom configuration file as ~/.xkb/keymap/xkbcustom
.
Install the new configuration with xkbcomp.
This is a compiler, so the user's path must be included, before configuration file and output to apply keymap ($DISPLAY
).
In our case: xkbcomp -I$HOME/.xkb ~/.xkb/keymap/xkbcustom $DISPLAY
.
To automate the installation each time a X session begins,
add the installation command to a .xinitrc file in the home folder.
If it is the first time you customize xinitrc
you will probably have to copy it from /etc/X11/xinit/xinitrc
to ~/.xinitrc
.
See more details about xinitrc.
The current configuration can be checked and debugged with
xkbcomp $DISPLAY xkb.dump
The file tree consists of:
-ll
is used to specify the level to printxkbprint $DISPLAY -ll 5 -o xkbprint_Fn.ps
Dealing with XKB configuration is not straighforward. As claimed in various blogs and documentation, there is plenty of examples on the internet (many of which may not work for you).
I will try to collect here some of those documents that were valuable for me.
setxkbmap
and xkbcomp
).