2

How do I remap caps-lock to caps-lock, preferably via bash? I mistakenly used the following command while in caps-lock was active:

setxkbmap -layout us -option ctrl:nocaps

I am trapped in caps-lock now. This happens to me about once every other month. I usually use the naive approach of rebooting my computer to fix this issue. I would like a better solution. I need to temporarily undo the above bash command, so that I can turn off caps-lock.

see: How do I remap the Caps Lock and Ctrl keys?

Alternative solutions:

  1. a bash command that toggles caps lock on/off.

  2. any other keyboard tricks that turn off caps-lock without caps-lock. I already tried the on-screen keyboard, but it contains no caps-lock key.

muru
  • 197,895
  • 55
  • 485
  • 740

1 Answers1

1

From Linux Mint:

sudo apt install xdotool

Then toggle the caps lock key with this command:

xdotool key Caps_Lock

Run this command again to turn caps lock off.