1

My keyboard setup is this command:

exec setxkbmap -layout us,us -variant altgr-intl,colemak -option caps:escape,grp:alt_shift_toggle

It maps caps lock to escape for qwerty, but in Colemak, there is a backspace key where caps lock used to be (which is why my question is not exactly the same as this one). I want to remap Colemak's left-backspace to escape, but keep my right-backspace key the same. Is there a way to do that, preferably with an easy command, like the command above?

Jonathan
  • 1,210
  • 4
  • 23
  • 41
  • Look at [xmodmap](https://wiki.archlinux.org/index.php/Xmodmap) – Ipor Sircer Dec 19 '17 at 17:00
  • 1
    Possible duplicate of [How can I make backspace act as escape using setxkbmap?](https://unix.stackexchange.com/q/212573/22142) – don_crissti Dec 19 '17 at 17:44
  • @donn_crissti disagree. it's not a duplicate of that; he's wrong about the no-capslock-key thing; but xkb isn't applying the `caps:escape` option to the second layout, which is the root of the question. (also ignore `xmodmap` suggestions.) – quixotic Dec 19 '17 at 17:57

1 Answers1

0

You can see in /usr/share/X11/xkb/symbols/us that the key is still called <CAPS> even though it produces BackSpace symbols.

Look at setxkbmap -print -- see the us(colemak):2 in the xkb_symbols line?

$ setxkbmap -print
xkb_keymap {
    xkb_keycodes  { include "evdev+aliases(qwerty)" };
    xkb_types     { include "complete"  };
    xkb_compat    { include "complete"  };
    xkb_symbols   { include "pc+us(altgr-intl)+us(colemak):2+inet(evdev)+group(alt_shift_toggle)+capslock(escape)" };
    xkb_geometry  { include "pc(pc105)" };
};

I think a +capslock(escape):2 added to that line should work, but doesn't seem to, and I'm not familiar enough with multiple-group layouts to know whether this is a general problem with XKB options or a syntax I'm missing.


You may need to provide a modified colemak definition:

// colemak layout with escape on capslock instead of backspace
partial alphanumeric_keys
xkb_symbols "colemak-esc" {
    // start with existing colemak layout
    include "us(colemak)"

    key <CAPS> { [ Escape, Escape, Escape, Escape ] }
};

You can add that to /usr/share/X11/xkb/symbols/us, or your own file in $HOME/.xkb/symbols, and load it with setxkbmap. See some additional references for where and how to load:

quixotic
  • 1,120
  • 12
  • 18