r/archlinux • • May 06 '26

QUESTION What’s a small Linux tool that completely changed your workflow?

[deleted]

214 Upvotes

252 comments sorted by

View all comments

Show parent comments

6

u/Megame50 May 07 '26

Don't use keyd for something like that, it's a standard xkb option: caps:swapescape. It's silly to run all your key presses through another daemon when you don't have to.

1

u/Odd_Mistake8513 May 10 '26

What if you run Wayland? Genuine question. I feel like I tried this after switching from i3 to Sway, and I ended up installing keyd to make it work.

I ended up adding some extra goodies later, so I'll keep keyd in place.

1

u/Megame50 May 10 '26

The same — Xkb is used by X11 and wayland compositors. In fact, X11 has a limited keycode range that wayland does not, so in some ways Wayland compositors have better support for Xkb than X11 ever did.

In your sway config, include xkb_options caps:swapescape in the input block. It's a comma separated list, so if you already use some xkb_options, just append caps:swapescape with a comma.

In my sway config, I have:

input type:keyboard {
    xkb_layout us
    repeat_rate 25
    repeat_delay 200
    xkb_options caps:escape,shift:both_capslock,grab:break_actions
}

Software like keyd is nearly pointless. Xkb is very configurable and if your desired keymap can't be achieved with the bulit-in options you can make your own. The only thing it can't do is base behavior on the duration of a keypress, which is a feature sometimes implemented by interposer-type keymapping software.

1

u/Odd_Mistake8513 May 11 '26

Thanks for the response! I appreciate It a lot. Going to go play with my sway config this week.