Skip to content

How can I permanently make caps lock an extra escape?

I have the command setxkbmap -option caps:escape in startup scripts to accomplish the above. But when I connect an external keyboard I need to run it again for it to have effect on the new keyboard. Is there a more permanent way to do this?

7 points6 comments
Open on Reddit
About this post
Posted
Archived
Score
7 · 100% up
Kind
Text
ID
nujcms

Author

20
posts
24
comments
1
media
View profile

6 comments

You can do it with udev. I have it set so the atkbd in my thinkpad acts as a Super button:

   evdev:atkbd:dmi:bvn*:bvr*:bd*:svn*:pn*:pvr*
  KEYBOARD_KEY_3a=leftmeta
3 points

Is this supposed to be one line and what is the equivalent of Esc/Tab?

1 points

You can make this persistent using Xorg configuration files. Putting the following into /etc/X11/xorg.conf.d/00-keyboard.conf should work:

Section "InputClass"
	Identifier "system-keyboard"
	MatchIsKeyboard "on"
	Option "XkbOptions" "caps:escape"
EndSection
3 points

The "localectl" tool can help write that 00-keyboard.conf file for you. The command line looks like this:

localectl set-x11-keymap us '' '' caps:escape
2 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.