Score:1

Need help converting Xmodmap to XKB

de flag

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?

Gunnar Hjalmarsson avatar
uz flag
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?
Score:0
jp flag
==> ~/.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" &
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.