Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save imabuddha/ea097255b48c842b8fc62e3243028676 to your computer and use it in GitHub Desktop.
Save imabuddha/ea097255b48c842b8fc62e3243028676 to your computer and use it in GitHub Desktop.
Add this line to /etc/xdg/lxsession/LXDE-pi/autostart
@imabuddha
Copy link
Author

imabuddha commented Dec 18, 2020

Best solution: add this line Option "XkbOptions" "ctrl:swapcaps" to the Identifier "libinput keyboard catchall" section of file /usr/share/X11/xorg.conf.d/40-libinput.conf. This will affect capslock for all kbds attached even before logging in to the gui, and will also apply when a kbd is hot-plugged.

Instead add Option "XkbOptions" "ctrl:swapcaps, compose:rctrl" to also map compose key to right ctrl key.

This is how it looks on Raspian as of 2020-12-19:

Section "InputClass"
        Identifier "libinput keyboard catchall"
        MatchIsKeyboard "on"
        MatchDevicePath "/dev/input/event*"
	Option "XkbOptions" "ctrl:swapcaps, compose:rctrl"
        Driver "libinput"
EndSection

@imabuddha
Copy link
Author

imabuddha commented Dec 29, 2020

2020-12-29, THIS IS THE WAY

Trying this to add a Colemak layout variant switchable by scroll lock:

Section "InputClass"
        Identifier "libinput keyboard catchall"
        MatchIsKeyboard "on"
        MatchDevicePath "/dev/input/event*"
#	Option "XkbModel" "pc101"
	Option "XkbLayout" "us,us"
	Option "XkbVariant" ",colemak"
	Option "XkbOptions" "ctrl:swapcaps, compose:rctrl, grp:sclk_toggle, grp_led:scroll"
        Driver "libinput"
EndSection

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment