9

Before Fedora switched to Wayland I used this .Xmodmap file to use my CapsLock Key to reach German Umlauts:

keycode 66 = Mode_switch Multi_key
keycode 20 = minus underscore ssharp
keycode 34 = bracketleft braceleft udiaeresis Udiaeresis
keycode 47 = semicolon colon odiaeresis Odiaeresis
keycode 48 = apostrophe quotedbl adiaeresis Adiaeresis

On Wayland this does not work any more - CapsLock would just work as before.

Is there a way to achieve the same result in Wayland, too?

8

For gnome you can use

gsettings set org.gnome.desktop.input-sources xkb-options "['caps:ctrl_modifier']"

While the preferred way for X is now

setxkbmap -option caps:ctrl_modifier

instead of xmodmap i believe. See this bugreport

| improve this answer | |
  • 7
    Where do you find the list of codes? ie How did you know the code was ctrl_modifier? – Aaron Skomra Jun 27 '17 at 22:26
  • 3
    This doesn't seem to work on Wayland/Sway – djsumdog Feb 19 '18 at 5:45
  • 1
    @djsumdog, the trick anon gave for wayland is gnome-shell specific. sway would have to implement their own version of this setting. alot of features that were handled by X11 will have to be handled by the window manager from now on. – thebunnyrules Feb 22 '18 at 6:30
  • gsettings worked for my Arch Linux 2019.02.01, but, setxkbmap solution not working. – zw963 Feb 26 '19 at 14:17
  • gsettings work for me on Ubuntu on Wayland 20.04 and persisted after reboot. – Boris Oct 7 at 3:16
1

For completeness: Under KWin/KDE you can remap Caps-Lock (and a few other control keys) quite flexibly using System settingsInput DevicesKeyboardAdvanced.

In particular you can set the Key to choose the 3rd level to Caps Lock to achieve your particular configuration.

– Much better than using Alt Gr when programming and losing Caps Lock in return is not really a loss at all.

(Die deutsche Bezeichnung ist übrigens: SystemeinstellungenEingabegeräteTastaturErweitertTaste zum Wechsel in die dritte TastaturebeneFeststelltaste.)

| improve this answer | |
0

For sway you can use:

export XKB_DEFAULT_OPTIONS=caps:escape

before running:

sway

reference https://github.com/swaywm/sway/wiki

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.