/keyboard_changes

This repo includes some keyboard modifications that I use on my systems.

Primary LanguageShell

keyboard_changes

This repo includes some keyboard modifications that I use on my systems.

I use the standard qwerty layout. In the following image, you can see the changes that I have implemented.

keyboard-layout normal

This feels a little buggy when you type too fast (this is not a bug, but a consequence of using the programs in this way). So you might want to be able to easily turn off Space + Control for fast typing.

keyboard-layout space_control_off

I have set up this mod using xcape (Thank you, /u/alols @github) and some other scripts.

Installation:

  1. First, back up your current xkb layout using:
$ xkbcomp :0 xkbLayoutBackup
  1. You have to set up xcape. Head over to https://github.com/alols/xcape and install it.

  2. Clone this repository.

$ git clone https://github.com/shrinidhihr98/keyboard_changes
  1. Cd into the repository:
$ cd keyboard_changes
  1. Make necessary changes to the paths in these lines in the scripts:

In keyboard_normal.sh:

xkbcomp -w 0 /path/to/keyboard_changes/xkbNormal $DISPLAY
#xmodmap /path/to/keyboard_changes/xmodmap_normal

and in keyboard_space_control_off.sh:

xkbcomp -w 0 /path/to/keyboard_changes/xkbSCO $DISPLAY
#xmodmap /path/to/keyboard_changes/xmodmap_space_control_off

Although lines containing xmodmap are comments, it is better to set them at once if you ever decide to switch between them.

  1. You will need to give the scripts some permissions in order to make them executable.
chmod +x keyboard_normal.sh
chmod +x keyboard_space_control_off.sh

Usage:

  1. It helps to set up aliases in your .bashrc to quickly change between layouts, like:
alias kk='/path/to/keyboard_changes/keyboard_normal.sh'
alias kj='/path/to/keyboard_changes/keyboard_space_control_off.sh'
  1. Now, you can type
$ kk

to enter the normal mode where you have Spacebar acting as a Space when pressed and released, and a Control modifier when used with other keys.

You can type

$ kj

to turn off the Space+Ctrl option and keep the other options the same.

Note:

There is an issue with speed and text appearing slower than expected, when using these scripts in Ubuntu 18.04.

xkb makes the scripts work a little faster. So, by default the scripts run with xkbcomp.

The xmodmap files are easily modifiable. But, xmodmap is depreciated. So, if you want to make any changes,

  1. Modify the xmodmap files.
  2. Comment out the xkbcomp lines and uncomment the xmodmap lines.
  3. Run the scripts: You can use the kk and kj aliases. Cd into the keyboard_changes folder and generate the new layouts.
$ kk
$ xkbcomp :0 xkbNormal
$ kj
$ xkbcomp :0 xkbSCO
  1. Now, revert back by commenting out the xmodmap lines and uncommenting xkbcomp lines.

Note that the change to xkbcomp causes a set of warnings to be displayed. These warnings are non-critical, and do not interfere in the working of these scripts. The warnings are raised for undefined and obscure keycodes which are not necessary. These warnings are disabled by putting -w 0 when calling xkbcomp. Look at Debian Bug report logs - #673035 and Bugzilla bug report log #66344 for more information.

However, if the scripts stop working, please raise an issue.