cosmic-epoch icon indicating copy to clipboard operation
cosmic-epoch copied to clipboard

Keyboard: Swapping CAPSLOCK with ESCAPE

Open theduke opened this issue 1 year ago • 8 comments

Is there any way to swap the CAPSLOCK with the ESCAPE key?

This is a very common setup/requirement for Vim users.

The classic XOrg approach is: setxkbmap -option capslock:swapescape.

theduke avatar Aug 08 '24 18:08 theduke

I'd love to see this as well. I'm not a vim user, but just years, and years, and years of muscle memory to having them swapped.

exstntlmsnthrp avatar Aug 08 '24 20:08 exstntlmsnthrp

You can configure that in ~/.config/cosmic/com.system76.CosmicComp/v1/xkb_config

Drakulix avatar Aug 09 '24 11:08 Drakulix

More specifically you'll want to add options: Some("caps:swapescape") to the config file. Example:

// ~/.config/cosmic/com.system76.CosmicComp/v1/xkb_config
(
    rules: "",
    model: "",
    layout: "us",
    variant: "",
    options: Some("caps:swapescape"),
    repeat_delay: 600,
    repeat_rate: 25,
)

jpttrssn avatar Aug 12 '24 04:08 jpttrssn

Yeah, I did try that.

This config seems to be overwritten on each login. Might be something happening in the greeter.

theduke avatar Aug 15 '24 07:08 theduke

My config was being overwritten when I had errors in my config file. Could that be the case for you? Are you seeing any errors such as errors loading cosmic-comp config logs in your /var/log/syslog?

jpttrssn avatar Aug 18 '24 12:08 jpttrssn

Thanks @jpttrssn! Any way to rebind so that Caps -> Esc Esc -> Esc (esc still works) Shift + Caps -> Caps

A-Walrus avatar Aug 22 '24 13:08 A-Walrus

Thanks @jpttrssn! Any way to rebind so that Caps -> Esc Esc -> Esc (esc still works) Shift + Caps -> Caps

You can use caps:escape_shifted_capslock. See man xkeyboard-config for all available options under Caps Lock behavior.

jpttrssn avatar Aug 24 '24 18:08 jpttrssn

Kinda related--is there a way to remap caps:escape_shifted_capslock and swapping left alt with meta in the Some(..,) args? Should it be a vec or a string?

t56k avatar Sep 10 '24 05:09 t56k

Anyone knows how to set CapsLock to Meta+Space, to switch IME like MacOS?

linonetwo avatar Dec 16 '24 08:12 linonetwo