I tried these:
First I tried with
xmodmapclear Lockkeycode 66 = F12
but the issue is that it would reset my custom mapping after every reboot or log out. Therefore I had to run the command xmodamp ~/.Xmodmap every single time after reboot or log out. Trying to automate doesn't help either because xmodamp ~/.Xmodmap would take like 10 seconds in order to run and during that time the whole computer is block, i.e. I could not switch to or use any other program.
Also I heard using xmodmap isn't really recommended.
- The next thing I tried was setting F12 in the file
/usr/share/X11/xkb/symbols/pc. I tried something like this:key <CAPS> {»-[ F12»»-]»};(<-- the»symbol representstabson my computer). But that doesn't seem to have any effect.
Is there a way to permanently remap the Caps Lock to the function key F12?