this post was submitted on 07 Apr 2025
18 points (87.5% liked)

Linux

52850 readers
2233 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

I use i3wm, and to map cap lock to escape, I run:

setxkbmap -option caps:swapescape

This works fine, but sometimes while hitting the F1 key, my pinky can accidentally hit the Escape key, which turns on CapsLock.

Gnome has a very nice way to do this, where Shift + Escape = CapsLock. Hitting Escape on its own will do nothing.

top 14 comments
sorted by: hot top controversial new old
[–] floquant@lemmy.dbzer0.com 1 points 17 minutes ago

Not what you asked for, but you may be interested in getting a keyboard running QMK where you can define these kind of modifier overloading (and much much more) on the keyboard itself, so it's "portable" and doesn't require OS/DE settings

[–] gomp@lemmy.ml 2 points 4 hours ago

I don't use that so I'm mostly shooting in the dark, but.. does caps:escape_shifted_capslock do what you want?

(source: localectl list-x11-keymap-options | grep esc)

[–] mina86@lemmy.wtf 3 points 4 hours ago

If everything else fails, there’s always an option of defining your own keymap and enabling it in initrc.

[–] gnuhaut@lemmy.ml 2 points 4 hours ago* (last edited 4 hours ago)

It's option caps:escape_shifted_capslock I think.

You can look through /usr/share/X11/xkb/rules/base.lst for all the options.

Edit: Just looked up when this was added, this is a new option from 2024:

https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/commit/6bf17ba73bd94dd02e036a8c99c4a684a83f13fb

[–] promitheas@programming.dev 2 points 5 hours ago (2 children)

Commenting because fellow caps-esc swap enthusiast, and I would like to know the answer as well

[–] bdonvr@thelemmy.club 1 points 5 hours ago* (last edited 5 hours ago) (3 children)

Wait why do people want escape there???

I like the backspace there like Colemak has. I can do Fn-Backspace(capslock) to activate Caps Lock but that's something I added to my Keyboard separately.

[–] fahfahfahfah@lemmy.billiam.net 6 points 4 hours ago (1 children)
[–] gwilikers@lemmy.ml 1 points 1 hour ago* (last edited 1 hour ago)

From my understanding, Esc was originally where the Caps lock is on earlier keyboard layouts. That's why it's bound to that in Vim. It's a holdover, so it makes sense to switch them back.

[–] BaconIsAVeg@lemmy.ml 2 points 4 hours ago

I have a ZSA Voyager and my escape key is on my left thumb, beside the space key.

For the life of me though I can't imagine why anyone is still using CAPSLOCK, vbU.

[–] Peasley@lemmy.world 1 points 3 hours ago (1 children)

I like Ctrl there, Unix/Sun layout. Backspace is also an interesting idea

[–] ShittyBeatlesFCPres@lemmy.world 1 points 54 minutes ago

I do that too. I almost never want to hit CAPS LOCK (and can type holding shift) but if you map it to CTRL or even something not on modern keyboards (like F15 or any number over 12, I guess), you can use it as a shortcut key.

Personally, I use CAPS (remapped to CTRL) plus Tilde as my shortcut to show/dismiss a Quake-style terminal overlay window. That key combo actually can be made to work on Windows and macOS too so it’s basically cross-platform.

I’m 99% sure macOS (with iTerm 2 setup for Quake-style) has a built-in system option to remap CAPS LOCK but it only allows a few keys. I forget the Windows method. I used to have to use Windows sometimes but it’s been awhile. I’ve definitely got it working with a third party terminal emulator and WSL2, though.

[–] umbrella@lemmy.ml 1 points 5 hours ago (1 children)

just curious: why do you like doing it?

[–] promitheas@programming.dev 3 points 2 hours ago

I switched because of neovim, and got used to it. I was never the kind of guy to press caps to type capitals, always just kept shift pressed down with my pinky, so i basically never used the caps key anyway

[–] dgow@lemmy.ml 1 points 5 hours ago