Skip to content

Instantly share code, notes, and snippets.

@datMaffin
Last active May 21, 2024 18:32
Show Gist options
  • Save datMaffin/22e0a058676b39558d25677801e69f8a to your computer and use it in GitHub Desktop.
Save datMaffin/22e0a058676b39558d25677801e69f8a to your computer and use it in GitHub Desktop.
xkbd keyboard layout configuration for better keyboard shortcuts accessing special characters needed for programming (for german qwertz keyboard layout)
partial alphanumeric_keys modifier_keys keypad_keys
xkb_symbols "de-lsgtmod" {
include "latin(type4)"
name[Group1]="German (less-than as modifier)";
key.type[Group1] = "EIGHT_LEVEL";
key <TLDE> {[dead_circumflex, degree, U2032, U2033 ]}; // ′ ″
key <AE02> {[ 2, quotedbl, twosuperior, oneeighth ]};
key <AE03> {[ 3, section, threesuperior, sterling ]};
key <AE04> {[ 4, dollar, onequarter, currency ]};
key <AE07> {[ 7, slash, braceleft, seveneighths, backslash, backslash ]};
key <AE08> {[ 8, parenleft, bracketleft, trademark, bracketleft, bracketleft ]};
key <AE09> {[ 9, parenright, bracketright, plusminus, bracketright, bracketright ]};
key <AE11> {[ ssharp, question, backslash, questiondown, U1E9E ], type[group1]="FOUR_LEVEL_PLUS_LOCK" };
key <AE12> {[dead_acute, dead_grave, dead_cedilla, dead_ogonek ]};
key.type[Group1] = "EIGHT_LEVEL_SEMIALPHABETIC";
key <AD03> {[ e, E, EuroSign, EuroSign ]};
key <AD06> {[ z, Z, leftarrow, yen ]};
key <AD07> {[ u, U, downarrow, uparrow, less, less ]};
key <AD08> {[ i, I, rightarrow, idotless, greater, greater ]};
key <AD11> {[udiaeresis, Udiaeresis, dead_diaeresis, dead_abovering ]};
key.type[Group1] = "EIGHT_LEVEL";
key <AD12> {[ plus, asterisk, asciitilde, macron ]};
key.type[Group1] = "EIGHT_LEVEL_ALPHABETIC";
key <AC06> {[ h, H, hstroke, Hstroke, bar, bar ]};
key <AC09> {[ l, L, lstroke, Lstroke, at, at ]};
key.type[Group1] = "EIGHT_LEVEL_SEMIALPHABETIC";
key <AC02> {[ s, S, U017F, U1E9E ]}; // ſ ẞ
key <AC07> {[ j, J, dead_belowdot, dead_abovedot, braceleft, braceleft ]};
key <AC08> {[ k, K, kra, ampersand, braceright, braceright ]};
key <AC10> {[odiaeresis, Odiaeresis, dead_doubleacute, dead_belowdot ]};
key <AC11> {[adiaeresis, Adiaeresis, dead_circumflex, dead_caron ]};
key <AB01> {[ y, Y, guillemotright, U203A ]}; // » ›
key <AB02> {[ x, X, guillemotleft, U2039 ]}; // « ‹
key <AB04> {[ v, V, doublelowquotemark, singlelowquotemark ]};
key <AB05> {[ b, B, leftdoublequotemark, leftsinglequotemark ]};
key <AB06> {[ n, N, rightdoublequotemark, rightsinglequotemark, asciitilde, asciitilde ]};
key.type[Group1] = "EIGHT_LEVEL";
key <AB08> {[ comma, semicolon, periodcentered, multiply ]};
key <AB09> {[ period, colon, U2026, division ]}; // … ÷
key <AB10> {[ minus, underscore, endash, emdash ]};
key <BKSL> {[numbersign, apostrophe, rightsinglequotemark, dead_breve ]};
include "kpdl(comma)"
include "level3(ralt_switch)"
include "level5(lsgt_switch)"
};
@datMaffin
Copy link
Author

datMaffin commented Nov 7, 2021

For keyboard layers >= 5 to work in GNOME Wayland, it is currently necessary for the layout to be the first in the list!

See also: https://gitlab.gnome.org/GNOME/mutter/-/issues/790

This might help in figuring out of how to install it: https://blog.stigok.com/2020/10/27/from-x11-xmodmap-to-wayland-xkb-custom-keyboard-layout.html

@datMaffin
Copy link
Author

xkeyboard-config 2.39 broke compatibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment