On 16/12/2021 01:53, 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?
I don't know if it's better, but there's a simple thing you can try first: I used to run setxkbmap -option compose:caps in my startup script to map the Capslock key to a Compose key. But this would unpredictably drop out. Now, in /etc/default/keyboard XKBOPTIONS="compose:caps" keeps the mapping reliably applied. Maybe there's a similar setting you could try? -- John