1

I want to make caps lock as control key, so I wrote this setxkbmap -option caps:ctrl_modifier to my bashrc file. The problem is that after I log in the next time or restart the system, nothing happened. Caps lock is still caps lock... So how to change caps lock to control key?

Daniel
  • 11

3 Answers3

1

To make that change system wide and persistent, open /etc/default/keyboard for editing, change the line

XKBOPTIONS=""

to

XKBOPTIONS="caps:ctrl_modifier"

and reboot.

Gunnar Hjalmarsson
  • 33,540
  • 3
  • 64
  • 94
0

~/.bashrcscript just change defaults at terminal session, and it doesn't extend to other areas of your environment. To make this, you could create a script file with this command in it, as:

#!/bin/sh
/usr/bin/setxkbmap -option caps:ctrl_modifier

Then you add it to your sesssion startup manager, as you can see here

Redbob
  • 1,596
0

I assigned the command to ~/.profile and it works. Now I see that ~/.bashrc script just change defaults at terminal session, people who are fresh to linux like me should notice this too. Thank you guys!

Daniel
  • 11