Thinkpad_hacks/custom_kbd_layout_gnome.md

2.3 KiB

1 - create layout, cz hack for example:

in /usr/share/X11/xkb/symbols create file for ex: czus

default partial alphanumeric_keys
xkb_symbols "basic" {

include "us(basic)"
name[Group1]= "Custom CZ - US";

key <AE12>	{ [equal,	  plus, dead_acute, dead_caron  ] };

key <AD02>	{ [         w,          W,     ecaron,     Ecaron ]	};
key <AD03>	{ [         e,          E,     eacute,     Eacute ]	};

key <AC01>	{ [         a,          A,     aacute,	     Aacute   ]	};
key <AD08>	{ [         i,          I,     iacute,	     Iacute   ]	};
key <AD09>	{ [         o,          O,     oacute,       Oacute   ]	};
key <AD06>	{ [         y,          Y,     yacute,       Yacute   ]	};
key <AD07>	{ [         u,          U,     uacute,	     Uacute    ]	};
key <AC07>	{ [         j,          J,     uring,	     Uring    ]	};

key <AC02>	{ [         s,          S,     scaron,       Scaron   ]	};
key <AB01>	{ [         z,          Z,     zcaron,	     Zcaron   ]	};
key <AB03>	{ [         c,          C,     ccaron,       Ccaron   ]	};
key <AD04>	{ [         r,          R,     rcaron,	     Rcaron   ]	};
key <AD05>	{ [         t,          T,     tcaron,	     Tcaron   ]	};
key <AC03>	{ [         d,          D,     dcaron,	     Dcaron   ]	};
key <AB06>	{ [         n,          N,     ncaron,	     Ncaron   ]	};

key <SPCE>  { [     space,       space, nobreakspace, nobreakspace] };

include "level3(ralt_switch)"
};

If using Gnome:

2 - name layout: custom

3 - under Gnome settings app choose A user-defined custom Layout

Else:

2 - edit /usr/share/X11/xkb/rules/evdev

under ! option = symbols add: czus:czhack = +czus(czhack)

3 - edit /usr/share/X11/xkb/rules/evdev.xml

under <layoutList> add:

<layout>
  <configItem>
    <name>czus</name>
    <shortDescription>Kuxa's czus</shortDescription>
    <description>czus</description>
    <languageList>
      <iso639Id>cze</iso639Id>
    </languageList>
  </configItem>
  <variantList>
    <variant>
      <configItem>
        <name>czus</name>
        <description>CZUS base</description>
      </configItem>
    </variant>
  </variantList>
</layout>

4 - edit /usr/share/X11/xkb/rules/evdev.lst

under ! layout add:

czus CZ hack for US kbd