I need to remap the Capslock key of my keyboard to backspace.

I use the command:

setxkbmap -option caps:backspace & xset r 66 

which works perfectly when run from the terminal. But if I set it to run at startup as a custom command trough System setings/Aplications/Startup (translated from Spanish), it doesn't work.

Am I doing something wrong?

  • Can you put your answer as an answer and not as en edit of your question, please?
    – lemonslice
    Jan 8, 2017 at 17:17

2 Answers 2


These are actually two commands, you might want to create a startup script ~/.local/bin/remap_capslock with the contents:

setxkbmap -option caps:backspace &
xset r 66 

set it to executable

chmod +x ~/.local/bin/remap_capslock

and run this script at startup

  • 1
    I would suggest using ~/.local/bin instead of ~/bin for several reasons: It already exists, it's hidden, and it's on the path.
    – Mike Wild
    Jan 8, 2017 at 16:08
  • It must be relatively a new thing, I always used ~/bin thanks for your suggestion!
    – lemonslice
    Jan 8, 2017 at 17:19
  • 1
    I just put it in my home folder.
    – Gabriel
    Jan 9, 2017 at 2:40

After making this question I realized that elementary OS can do this via settings, with no need to mess with configuration files. Just go to System settings/Keyboard/Layout and select your desired Capslock behaviour.

enter image description here

The bad news is that it doesn't work if you keep the key pressed (as the Backspace key does)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.