On Wed 15 Dec 2021 at 16:53:54 (+0000), Tim Woodall wrote: > I run the following command to switch my caps-lock to escape: > xmodmap -e 'clear Lock' -e 'keycode 0x42 = Escape' > > However, if I disconnect and reconnect my keyboard (I have a KVM switch > box so this happens quite a lot) the setting is lost. > > Before I start writing udev rules to auto reapply this setting when the > keyboard is (re)attached, is there some other, better, way to make this > setting stick?
You could try editing /etc/console-setup/remap.inc and running # dpkg-reconfigure console-setup A change at that level might be inherited by whatever's restarting and causing you to lose the settings. Note that for whatever reason (lost in the mists), I always run dpkg-reconfigure console-setup while X is not running, ie not even in a C-A-Fn virtual console. That constraint might have changed, IDK. Cheers, David.