On my computer running Xubuntu 20.04 I block the key CapsLock by issuing
setxkbmap -option caps:none
through xfce4-settings-settings on login.
I would like to have this key disabled even before, i.e. during the login phase.
CapsLock is not enabled in the BIOS by default.
I support a user who often accidentally presses CapsLock and then he can't log in himself. I would like to help him, as I have already helped him after logging into the system. - The Insert key is also a candidate that often causes avoidable confusion by causing the overwrite mode. This key is also easily pressed accidentally or even just pressed along.
Is this possible?
How can I achieve this goal?
lightdm --show-config gives me this:
a@W:~$ lightdm --show-config
[Seat:*]
J allow-guest=false
L greeter-wrapper=/usr/lib/lightdm/lightdm-greeter-session
M guest-wrapper=/usr/lib/lightdm/lightdm-guest-session
N xserver-command=X -core
O greeter-setup-script=xubuntu-numlockx
P greeter-session=lightdm-gtk-greeter
Q user-session=xubuntu
R type=xlocal
R display-setup-script=/sbin/prime-offload
R display-stopped-script=/sbin/prime-switch
[LightDM]
K backup-logs=false
Sources:
J /usr/share/lightdm/lightdm.conf.d/50-disable-guest.conf
K /usr/share/lightdm/lightdm.conf.d/50-disable-log-backup.conf
L /usr/share/lightdm/lightdm.conf.d/50-greeter-wrapper.conf
M /usr/share/lightdm/lightdm.conf.d/50-guest-wrapper.conf
N /usr/share/lightdm/lightdm.conf.d/50-xserver-command.conf
O /usr/share/lightdm/lightdm.conf.d/50-xubuntu-numlock.conf
P /usr/share/lightdm/lightdm.conf.d/60-lightdm-gtk-greeter.conf
Q /usr/share/lightdm/lightdm.conf.d/60-xubuntu.conf
R /usr/share/lightdm/lightdm.conf.d/90-nvidia.conf
J /usr/share/lightdm/lightdm.conf.d/50-disable-guest.conf
K /usr/share/lightdm/lightdm.conf.d/50-disable-log-backup.conf
L /usr/share/lightdm/lightdm.conf.d/50-greeter-wrapper.conf
M /usr/share/lightdm/lightdm.conf.d/50-guest-wrapper.conf
N /usr/share/lightdm/lightdm.conf.d/50-xserver-command.conf
O /usr/share/lightdm/lightdm.conf.d/50-xubuntu-numlock.conf
P /usr/share/lightdm/lightdm.conf.d/60-lightdm-gtk-greeter.conf
Q /usr/share/lightdm/lightdm.conf.d/60-xubuntu.conf
R /usr/share/lightdm/lightdm.conf.d/90-nvidia.conf
a@W:~$
I first asked for a hook for commands to be carried out before the login procedure. One comment suggested to set up a crontab with
sudo crontab -e
and add the line
@reboot /usr/bin/setxkbmap -option caps:none
Unfortunately this does not do the job. I could verify that the crontab actually is carried out (see my own comment below), but the invoked command /usr/bin/setxkbmap -option caps:none might be overwritten by the login procedure before it actually asks for the password. (Does it first reset all keyboard-configuration to some default?)
What is the login procedure in Xubuntu 20.04? Is it lightdm or is it lightdm-gtk-greeter?
Would it be possible to issue the command setxkbmap -option caps:none from within some of the lightdm-configuration files such that it is effective when the password is input?