1

I've been using this .Xmodmap for years but now I'm switching to Wayland and I need to replace it:

!remove Lock = Caps_Lock

keycode  66 = Mode_switch
keycode 108 = Mode_switch

keycode  26 = e E EuroSign cent
keycode  30 = u U udiaeresis Udiaeresis
keycode  32 = o O odiaeresis Odiaeresis
keycode  38 = a A adiaeresis Adiaeresis
keycode  39 = s S ssharp

The .Xmodmap above disables Caps-Lock and for example pressing Caps-Lock + u results in an ü. It is a slightly modified version of this.

I tried to do it on my own and came up with something like this which doesn't work :(

partial modifier_keys
xkb_symbols "caps_lock" {
    key <CAPS> {
        type[Group1] = "MODIFIER_LOCK",
        modifiers = "Control",
        control = "Control_L",
        lock = "Caps Lock"
    };
};

partial keys
xkb_symbols "my_layout" {
    key <AE01> { [ e, E, EuroSign, cent ] };
    key <AE02> { [ u, U, udiaeresis, Udiaeresis ] };
    key <AE03> { [ o, O, odiaeresis, Odiaeresis ] };
    key <AE04> { [ a, A, adiaeresis, Adiaeresis ] };
    key <AE05> { [ s, S, ssharp ] };
};


partial xkb_layouts "my_layout" {
    xkb_symbols "default" {
        include "us"
        include "caps_lock"
        include "keys(my_layout)"
    };
};

Can someone point me in the right direction?

1
  • I would recommend that you also describe the desired changes in plain English. Also, try to be a bit more specific about what "something like this" is. For example, are those new files, and in that case what's the file paths, and otherwise if they are additions to existing files, which files are those? Mar 29, 2023 at 20:57

1 Answer 1

0
==> ~/.config/xkb/symbols/b <==
partial alphanumeric_keys modifier_keys keypad_keys
xkb_symbols "b" {
    key <AE01> { [ e, E, EuroSign, cent ] };
};
==> ~/.config/xkb/main <==
/* Replace de by your language keyboard code. */
xkb_keymap {
  xkb_keycodes{include "evdev+aliases(qwerty)"};
  xkb_types   {include "complete"};
  xkb_compat  {include "complete"};
  xkb_symbols {include "pc+de+inet(evdev)+level3(caps_switch)+b(b)"};
  xkb_geometry{include "pc(pc105)"};
};

On start up,

xkbcomp -I"$HOME/.config/xkb" "$HOME/.config/xkb/main" "$DISPLAY" &

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .