How to persistently map Capslock to ESC and Ctrl?

Hi, I’ve recently switched from Ubuntu to Fedora. Previously, I’ve used the following in my ~/.xprofileto map Capslock to ESC and Ctrl:

# make CapsLock behave like Ctrl:                                
setxkbmap -option ctrl:nocaps
# make short-pressed Ctrl behave like Escape:
xcape -e 'Control_L=Escape'

This doesn´t work in Fedora 40 anymore. How can I get the same functionality here? I’m using KDE by the way.

Thanks in advance for every help!

I web search for linux wayland key mapping offers up lots of useful links.
Please let us know what worked for you.

Sometimes it’s so simple that it feels a bit embarrassing. Thanks @barryascott for this hint! I’ve found https://github.com/wez/evremap which is exactly what I was looking for :+1:

1 Like