I routinely disable Caps Lock and the respective modifier with a script, using
xmodmap. That all works fine.
Sometimes, however, for some reason unknown, Caps Lock is active. Having no key bound to
Caps_Lock and no key bound to toggle the
Lock modifier, I cannot switch Caps Lock off unless I reset the keymap, press the key, then re-map it to my desired configuration.
So: How can I disable Caps Lock (currently active) without re-mapping keys and with no keys bound to do the job?
Perhaps a command line tool can set the state?
For anyone interested, here is how my script disables the accidental activation of Caps Lock by a key press (I never enable it intentionally):
#!/bin/sh # I never want to use Caps_Lock. Make Caps_Lock another Control_L... xmodmap -e "remove Lock = Caps_Lock" 2> /dev/null xmodmap -e "keysym Caps_Lock = Control_L" 2> /dev/null xmodmap -e "add Control = Control_L" 2> /dev/null