I use Linux on a Macbook with a UK/GB keyboard and I customize the keymap to solve some problems Apple's weird keyboard layout causes. I use xmodmap
to do this. I'd like to try Wayland, but xmodmap
doesn't work in that. How can I achieve a similar result in Wayland? The .Xmodmap
file I use contains the following:
keycode 12 = 3 numbersign 3 sterling sterling sterling threesuperior sterling
clear Control
clear Mod4
add Control = Control_L Super_R
add Mod4 = Super_L
keysym Caps_Lock = NoSymbol Caps_Lock
Line 1: On UK keyboards Shift-3 is £, so # usually has its own key near Return. But on the Mac # is obtained with Altgr-3. As a programmer I use # far more than £ so this line swaps them over. Selecting US layout also achieves this, but doing that in Linux also swaps some other commonly used keys, whereas in OS X those other keys are unaffected by US/UK.
Lines 2-5: Make the right Cmd key act as Right-Ctrl, because this keyboard has no physical right Ctrl key.
Line 6: Makes CapsLock only work if you press it with Shift. Not Mac-specific, this should be a standard option for all OSs and keyboards.
</facepalm>
– Cecil Curry Dec 05 '23 at 03:47