Skip to content

Instantly share code, notes, and snippets.

@v6ak
Created February 5, 2020 23:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save v6ak/7cdf4d2054739d1868f750ecee8134cb to your computer and use it in GitHub Desktop.
Save v6ak/7cdf4d2054739d1868f750ecee8134cb to your computer and use it in GitHub Desktop.
CShack + numpad emulation
// CShack for Linux, version 1.1, 2016-03-14
// (C) 2012-2016 Ladislav Matula <ladislav.matula*gmail.com>, www.xakru.com/cshack/
// (C) 2008 Michal Berg <m.berg*centrum.cz>
// (C) 2014-2016 Vít Šesták https://contact.v6ak.com
// Public domain
// CShack - Czech and Slovak 1337 keyboard layout
// - Caps-Lock is a new 'shift', without pressing this new 'shift' it behaves like the standard en_US layout
// - almost every key has two new characters - Caps-Lock + <char> and Shift + Caps-Lock + <char>
// - chars with diacritics are at (or close to) their basic glyph, Caps-Lock + a => á, Shift + Caps-Lock + a => Á, Caps-Lock + t => ť ...
// - 4 variants: (German/Spanish | Esperanto) x (qwerty | qwertz)
// - contains many typographic characters
// Variants
// default - qwerty, languages: Czech, Slovak, German, Spanish
// qwertz - qwertz, languages: Czech, Slovak, German, Spanish
// Esperanto - qwerty, languages: Czech, Slovak, Esperanto
// Esperanto qwertz - qwertz, languages: Czech, Slovak, Esperanto
// extracs - qwerty, replaces number row by Czech “+ěščřžýáíé” (useful for keyboards with numpad)
// extracs qwertz - qwertz, replaces number row by Czech “+ěščřžýáíé” (useful for keyboards with numpad)
// extrask - qwerty, replaces number row by Slovak “+ľščťžýáíé” (useful for keyboards with numpad)
// extrask qwertz - qwertz, replaces number row by Slovak “+ľščťžýáíé” (useful for keyboards with numpad)
// *_ralt - variants with right alt acting as CShack key (useful for laptops without right alt)
// ESPERANTO CHARS
// ĉ, ĝ, ĥ, ĵ, ŝ and ŭ = c, g, h, j, s + circumflex, u + breve
// Developed in Kubuntu - don't hesitate to e-mail other ways of installation
// Tips for former editing
// 1) For defined symbol names see /usr/include/X11/keysymdef.h
// missing chars must be written in Unicode format eg. U0125 or in hexa eg. 0x100178b
// 2) compiled files are in /var/lib/xkb, delete this folder and restart Xwindow is for sure rebuild
// Installation (root rights needed!)
//-------------
// Kubuntu 12
//-------------
//
// 1) cp CShack /usr/share/X11/xkb/symbols
//
//
// 2) add following code to /usr/share/X11/xkb/rules/evdev.xml (without //)
//
// <layout>
// <configItem>
// <name>CShack</name>
// <shortDescription>CSh</shortDescription>
// <description>CShack</description>
// <languageList>
// <iso639Id>cze</iso639Id>
// <iso639Id>slo</iso639Id>
// <iso639Id>epo</iso639Id>
// <iso639Id>ger</iso639Id>
// <iso639Id>spa</iso639Id>
// </languageList>
// </configItem>
// <variantList>
// <variant>
// <configItem>
// <name>epo</name>
// <description>CShack (Esperanto)</description>
// </configItem>
// </variant>
// <variant>
// <configItem>
// <name>qwertz</name>
// <description>CShack (qwertz)</description>
// </configItem>
// </variant>
// <variant>
// <configItem>
// <name>epo_qwertz</name>
// <description>CShack (Esperanto qwertz)</description>
// </configItem>
// </variant>
// <variant>
// <configItem>
// <name>extracs</name>
// <description>CShack (extra Czech symbols)</description>
// </configItem>
// </variant>
// <variant>
// <configItem>
// <name>extracs_qwertz</name>
// <description>CShack (qwertz + extra Czech symbols)</description>
// </configItem>
// </variant>
// <variant>
// <configItem>
// <name>extrask</name>
// <description>CShack (extra Slovak symbols)</description>
// </configItem>
// </variant>
// <variant>
// <configItem>
// <name>extrask_qwertz</name>
// <description>CShack (qwertz + extra Slovak symbols)</description>
// </configItem>
// </variant>
// <variant>
// <configItem>
// <name>ralt</name>
// <description>CShack (right alt)</description>
// </configItem>
// </variant>
// <variant>
// <configItem>
// <name>qwertz_ralt</name>
// <description>CShack (qwertz + right alt)</description>
// </configItem>
// </variant>
// <variant>
// <configItem>
// <name>epo_ralt</name>
// <description>CShack (Esperanto + right alt)</description>
// </configItem>
// </variant>
// <variant>
// <configItem>
// <name>epo_qwertz_ralt</name>
// <description>CShack (qwertz + extra Esperanto symbols + right alt)</description>
// </configItem>
// </variant>
// <variant>
// <configItem>
// <name>extracs_ralt</name>
// <description>CShack (extra Czech symbols + right alt)</description>
// </configItem>
// </variant>
// <variant>
// <configItem>
// <name>extracs_qwertz_ralt</name>
// <description>CShack (qwertz + extra Czech symbols + right alt)</description>
// </configItem>
// </variant>
// <variant>
// <configItem>
// <name>extrask_ralt</name>
// <description>CShack (extra Slovak symbols + right alt)</description>
// </configItem>
// </variant>
// <variant>
// <configItem>
// <name>extrask_qwertz_ralt</name>
// <description>CShack (qwertz + extra Slovak symbols + right alt)</description>
// </configItem>
// </variant>
// </variantList>
// </layout>
partial default alphanumeric_keys modifier_keys xkb_symbols "basic"
{
name[Group1]= "CShack";
key <LSGT> {
[Mode_switch, Mode_switch]
};
key <CAPS> {[ ISO_Level3_Shift, ISO_Level3_Shift ]};
key <RWIN> {
type[Group1]="ONE_LEVEL",
symbols[Group1] = [ ISO_Level3_Shift ]
};
// This is probably unneeded:
//modifier_map Mod5 { ISO_Level3_Shift };
// key <RALT> { [ Multi_key ] };
key <TLDE> {[ grave, asciitilde, approxeq, exclamdown ]};
key <AE01> {[ 1, exclam, section, trademark ], [1, 1, 1, 1]};
key <AE02> {[ 2, at, registered, copyright ], [2, 2, 2, 2]};
key <AE03> {[ 3, numbersign, Greek_pi, numerosign ], [3, 3, 3, 3]};
key <AE04> {[ 4, dollar, EuroSign, cent ], [4, 4, 4, 4]};
key <AE05> {[ 5, percent, degree, U2030 ], [5, 5, 5, 5]};//permille!
key <AE06> {[ 6, asciicircum, minutes, radical ], [6, 6, 6, 6]};
key <AE07> {[ 7, ampersand, seconds, cuberoot ], [7, 7, 7, 7]};
key <AE08> {[ 8, asterisk, infinity, dagger ], [8, 8, 8, 8]};
key <AE09> {[ 9, parenleft, singlelowquotemark, U2211 ], [9, 9, 9, 9]};//summation!
key <AE10> {[ 0, parenright, leftsinglequotemark, rightsinglequotemark ], [0, 0, 0, 0]};
key <AE11> {[ minus, underscore, endash, emdash ]};
key <AE12> {[ equal, plus, notequal, plusminus ]};
key <BKSL> {[ backslash, bar, U2250, identical ]};//approlimit!
//key <LSGT> {[ backslash, bar, U2250, identical ]};//approlimit!
key <AD01> {[ q, Q, adiaeresis, Adiaeresis ]};
key <AD02> {[ w, W, ecaron, Ecaron ]};
key <AD03> {[ e, E, eacute, Eacute ]};
key <AD04> {[ r, R, rcaron, Rcaron ]};
key <AD05> {[ t, T, tcaron, Tcaron ]};
key <AD06> {[ y, Y, yacute, Yacute ]};
key <AD07> {[ u, U, uacute, Uacute ], [4, 4, 4, 4]};
key <AD08> {[ i, I, iacute, Iacute ], [5, 5, 5, 5]};
key <AD09> {[ o, O, oacute, Oacute ], [6, 6, 6, 6]};
key <AD10> {[ p, P, odiaeresis, Odiaeresis ]};
key <AD11> {[ bracketleft, braceleft, guillemotleft, U2039 ]};//anglequoleft!
key <AD12> {[ bracketright, braceright, guillemotright, U203A ]};//anglequoright!
key <AC01> {[ a, A, aacute, Aacute ]};
key <AC02> {[ s, S, scaron, Scaron ]};
key <AC03> {[ d, D, dcaron, Dcaron ]};
key <AC04> {[ f, F, ediaeresis, Ediaeresis ]};
key <AC05> {[ g, G, racute, Racute ]};
key <AC06> {[ h, H, uring, Uring ]};
key <AC07> {[ j, J, udiaeresis, Udiaeresis ], [1, 1, 1, 1]};
key <AC08> {[ k, K, ocircumflex, Ocircumflex ], [2, 2, 2, 2]};
key <AC09> {[ l, L, lcaron, Lcaron ], [3, 3, 3, 3]};
key <AC10> {[ semicolon, colon, doublelowquotemark, brokenbar ]};
key <AC11> {[ apostrophe, quotedbl, leftdoublequotemark, rightdoublequotemark ]};
key <AB01> {[ z, Z, zcaron, Zcaron ]};
key <AB02> {[ x, X, ntilde, Ntilde ]};
key <AB03> {[ c, C, ccaron, Ccaron ]};
key <AD10> {[ p, P, odiaeresis, Odiaeresis ]};
key <AC04> {[ f, F, ediaeresis, Ediaeresis ]};
key <AC07> {[ j, J, udiaeresis, Udiaeresis ]};
key <AB02> {[ x, X, ntilde, Ntilde ]};
key <AB04> {[ v, V, NoSymbol, NoSymbol ]};
key <AB05> {[ b, B, ssharp, Greek_mu ]};
key <AB06> {[ n, N, ncaron, Ncaron ]};
key <AB07> {[ m, M, lacute, Lacute ], [0, 0, 0, 0]};
key <AB08> {[ comma, less, periodcentered, lessthanequal ], [0, 0, 0, 0]};
key <AB09> {[ period, greater, ellipsis, greaterthanequal ]};
key <AB10> {[ slash, question, Greek_mu, questiondown ]};
key <SPCE> {[ space, space, nobreakspace, nobreakspace ]};
//U+2002 EN SPACE (U+2002)   arial_unicode_ms
//U+2003 EM SPACE (U+2003)   arial_unicode_ms
//U+2007 FIGURE SPACE (U+2007)   arial_unicode_ms
//U+2008 PUNCTUATION SPACE (U+2008)
//U+2009 THIN SPACE (U+2009)   arial_unicode_ms
//U+200A HAIR SPACE (U+200A)   arial_unicode_ms
// remapping numlock does not work there
// but you can use something like: xmodmap -e "keycode 77 = Menu"
// If you want to play with that in xkb, you can try http://xkbconfig.livejournal.com/7996.html
//key <Num> {[ Menu, Menu, Menu, Menu ]};
//key <LCTL> { [ Super_L, Super_L ] };
// key <RCTL> { [ Super_R, Super_R ] };
//modifier_map <Num> { 1 };
key <KP1> {[ 1, 1, onesuperior, onethird ]};
key <KP2> {[ 2, 2, twosuperior, onehalf ]};
key <KP3> {[ 3, 3, threesuperior, threequarters ]};
key <KP4> {[ 4, 4, foursuperior, onequarter ]};
key <KP5> {[ 5, 5, fivesuperior, fiveeighths ]};
key <KP6> {[ 6, 6, sixsuperior, twothirds ]};
key <KP7> {[ 7, 7, sevensuperior, seveneighths ]};
key <KP8> {[ 8, 8, eightsuperior, oneeighth ]};
key <KP9> {[ 9, 9, ninesuperior, threeeighths ]};
key <KP0> {[ 0, 0, zerosuperior, 0 ]};
key <KPAD> {[ plus, plus, U207A, U207A ]}; //SUPERSCRIPT PLUS U207A
key <KPDV> {[ divide, divide, U00F7, U2215 ]}; //DIVISION SLASH U2215, DIVISION U00F7
key <KPMU> {[ asterisk, asterisk, U00D7, U00D7 ]}; //MULTIPLICATION U00D7 multiply
key <KPSU> {[ minus, minus, U207B, U207B ]}; //SUPERSCRIPT MINUS U207B
key <KPDL> {[ KP_Decimal, KP_Decimal, comma, ellipsis ]}; //
};
//KP_Delete, KP_Separator464
// Bare variants – they don't include the basic layout in order to be combinable.
partial alphanumeric_keys modifier_keys xkb_symbols "ralt-bare"
{
key <RALT> {
type[Group1]="ONE_LEVEL",
symbols[Group1] = [ ISO_Level3_Shift ]
};
};
partial alphanumeric_keys modifier_keys xkb_symbols "extracs-bare"
{
key <AE01> {[ plus, exclam, section, trademark ]};
key <AE02> {[ ecaron, at, registered, copyright ]};
key <AE03> {[ scaron, numbersign, Greek_pi, numerosign ]};
key <AE04> {[ ccaron, dollar, EuroSign, cent ]};
key <AE05> {[ rcaron, percent, degree, U2030 ]};//permille!
key <AE06> {[ zcaron, asciicircum, minutes, radical ]};
key <AE07> {[ yacute, ampersand, seconds, cuberoot ]};
key <AE08> {[ aacute, asterisk, infinity, dagger ]};
key <AE09> {[ iacute, parenleft, singlelowquotemark, U2211 ]};//summation!
key <AE10> {[ eacute, parenright, leftsinglequotemark, rightsinglequotemark ]};
};
partial alphanumeric_keys modifier_keys xkb_symbols "extrask-bare"
{
key <AE01> {[ plus, exclam, section, trademark ]};
key <AE02> {[ lcaron, at, registered, copyright ]};
key <AE03> {[ scaron, numbersign, Greek_pi, numerosign ]};
key <AE04> {[ ccaron, dollar, EuroSign, cent ]};
key <AE05> {[ tcaron, percent, degree, U2030 ]};//permille!
key <AE06> {[ zcaron, asciicircum, minutes, radical ]};
key <AE07> {[ yacute, ampersand, seconds, cuberoot ]};
key <AE08> {[ aacute, asterisk, infinity, dagger ]};
key <AE09> {[ iacute, parenleft, singlelowquotemark, U2211 ]};//summation!
key <AE10> {[ eacute, parenright, leftsinglequotemark, rightsinglequotemark ]};
};
partial alphanumeric_keys modifier_keys xkb_symbols "epo-bare"
{
key <AD10> {[ p, P, U016D, U016C ]}; // ŭ Ŭ
key <AC04> {[ f, F, U011D, U011C ]}; // ĝ Ĝ
key <AC07> {[ j, J, U0135, U0134 ]}; // ĵ Ĵ
key <AB02> {[ x, X, U015D, U015C ]}; // Ŝ ŝ
key <AB04> {[ v, V, U0109, U0108 ]}; // Ĉ ĉ
key <AB05> {[ b, B, U0125, U0124 ]}; // ĥ Ĥ
};
partial alphanumeric_keys modifier_keys xkb_symbols "qwertz-bare"
{
key <AD06> {[ z, Z, zcaron, Zcaron ]};
key <AB01> {[ y, Y, yacute, Yacute ]};
};
// Final combinations of bare variants
partial alphanumeric_keys modifier_keys xkb_symbols "qwertz"
{
name[Group1]= "CShack (qwertz)";
include "CShack(qwertz-bare)"
augment "CShack(basic)"
};
partial alphanumeric_keys modifier_keys xkb_symbols "epo"
{
name[Group1]= "CShack (epo)";
include "CShack(epo-bare)"
augment "CShack(basic)"
};
partial alphanumeric_keys modifier_keys xkb_symbols "epo_qwertz"
{
name[Group1]= "CShack (epo qwertz)";
include "CShack(qwertz-bare)"
include "CShack(epo-bare)"
augment "CShack(basic)"
};
partial alphanumeric_keys modifier_keys xkb_symbols "extracs"
{
name[Group1]= "CShack (extra Czech symbols – +ěščřžýáíé)";
include "CShack(extracs-bare)"
augment "CShack(basic)"
};
partial alphanumeric_keys modifier_keys xkb_symbols "extracs_qwertz"
{
name[Group1]= "CShack (qwertz, extra Czech symbols – +ěščřžýáíé)";
include "CShack(extracs-bare)"
include "CShack(qwertz)"
augment "CShack(basic)"
};
partial alphanumeric_keys modifier_keys xkb_symbols "extrask"
{
name[Group1]= "CShack (extrask Slovak symbols – +ľščťžýáíé)";
include "CShack(extrask-bare)"
augment "CShack(basic)"
};
partial alphanumeric_keys modifier_keys xkb_symbols "extrask_qwertz"
{
name[Group1]= "CShack (qwertz, extrask Slovak symbols – +ľščťžýáíé)";
include "CShack(qwertz)"
include "CShack(extrask-bare)"
augment "CShack(basic)"
};
partial alphanumeric_keys modifier_keys xkb_symbols "ralt"
{
name[Group1]= "CShack (+right alt)";
include "CShack(ralt-bare)"
augment "CShack(basic)"
};
partial alphanumeric_keys modifier_keys xkb_symbols "qwertz_ralt"
{
name[Group1]= "CShack (qwertz, +right alt)";
include "CShack(ralt-bare)"
include "CShack(qwertz-bare)"
augment "CShack(basic)"
};
partial alphanumeric_keys modifier_keys xkb_symbols "epo_ralt"
{
name[Group1]= "CShack (epo, +right alt)";
include "CShack(ralt-bare)"
include "CShack(epo-bare)"
augment "CShack(basic)"
};
partial alphanumeric_keys modifier_keys xkb_symbols "epo_qwertz_ralt"
{
name[Group1]= "CShack (epo qwertz, +right alt)";
include "CShack(ralt-bare)"
include "CShack(qwertz-bare)"
include "CShack(epo-bare)"
augment "CShack(basic)"
};
partial alphanumeric_keys modifier_keys xkb_symbols "extracs_ralt"
{
name[Group1]= "CShack (extra Czech symbols – +ěščřžýáíé, +right alt)";
include "CShack(ralt-bare)"
include "CShack(extracs-bare)"
augment "CShack(basic)"
};
partial alphanumeric_keys modifier_keys xkb_symbols "extracs_qwertz_ralt"
{
name[Group1]= "CShack (qwertz, extra Czech symbols – +ěščřžýáíé, +right alt)";
include "CShack(ralt-bare)"
include "CShack(extracs-bare)"
include "CShack(qwertz)"
augment "CShack(basic)"
};
partial alphanumeric_keys modifier_keys xkb_symbols "extrask_ralt"
{
name[Group1]= "CShack (extrask Slovak symbols – +ľščťžýáíé, +right alt)";
include "CShack(extrask-bare)"
include "CShack(ralt-bare)"
augment "CShack(basic)"
};
partial alphanumeric_keys modifier_keys xkb_symbols "extrask_qwertz_ralt"
{
name[Group1]= "CShack (qwertz, extrask Slovak symbols – +ľščťžýáíé, +right alt)";
include "CShack(ralt-bare)"
include "CShack(qwertz)"
include "CShack(extrask-bare)"
augment "CShack(basic)"
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment