From 919f5d87b14e3531d05836bced7fde201604666a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charlotte=20=F0=9F=A6=9D=20Delenk?= Date: Sat, 29 Jul 2023 13:54:19 +0100 Subject: [PATCH] Add custom lojban keyboard layout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit the zbalermorna table from [[66052d3d576e1e0235e7991151231ed500521274]] wasn’t satisfactory, so I created a keyboard layout based on neo2 for lojban. cf [[202307291336 - Custom lojban keyboard]], [[202307291348 - Custom Keyboard Layouts on NixOS]] --- config/desktop.nix | 5 + extra/fcitx-table-extra.patch | 122 +----------------------- extra/keyboard/symbols | 172 ++++++++++++++++++++++++++++++++++ 3 files changed, 179 insertions(+), 120 deletions(-) create mode 100644 extra/keyboard/symbols diff --git a/config/desktop.nix b/config/desktop.nix index 00ca99d4..1eb851cd 100644 --- a/config/desktop.nix +++ b/config/desktop.nix @@ -142,6 +142,11 @@ in { layout = "de"; xkbVariant = "neo"; displayManager.lightdm.enable = lib.mkForce false; + extraLayouts.zlr = { + description = "lojban layout"; + languages = ["jbo"]; + symbolsFile = ../extra/keyboard/symbols; + }; }; boot.kernelPackages = pkgs.zfsUnstable.latestCompatibleLinuxPackages; i18n.inputMethod = { diff --git a/extra/fcitx-table-extra.patch b/extra/fcitx-table-extra.patch index db5f6b32..336257b9 100644 --- a/extra/fcitx-table-extra.patch +++ b/extra/fcitx-table-extra.patch @@ -6,9 +6,9 @@ index 9980fba..0ff6ee7 100644 wubi-large zhengma-large zhengma-pinyin t9 wubi98 wubi98-pinyin wubi98-single -+ sitelen-pona zlm ++ sitelen-pona ) - + set(MB_FILE) diff --git a/tables/sitelen-pona.conf.in b/tables/sitelen-pona.conf.in new file mode 100644 @@ -211,121 +211,3 @@ index 0000000..e2ea155 +_ 󱦒 +pi_ 󱦓 +' 󱦔 -diff --git a/tables/zlm.conf.in b/tables/zlm.conf.in -new file mode 100644 -index 0000000..08b95bf ---- /dev/null -+++ b/tables/zlm.conf.in -@@ -0,0 +1,40 @@ -+[InputMethod] -+Name=zbalermorna -+Icon=fcitx-zbalermorna -+Label= -+LangCode=jbo -+Addon=table -+Configurable=True -+ -+[Table] -+File=table/zlm.main.dict -+OrderPolicy=No -+PinyinKey=[ -+AutoSelect=False -+MatchingKey=@ -+ExactMatch=False -+Hint=True -+DisplayCustomHint=True -+IgnorePunc=True -+PageSize=9 -+CandidateLayoutHint=Vertical -+ -+[Table/Selection] -+0=Alt+1 -+1=Alt+2 -+2=Alt+3 -+3=Alt+4 -+4=Alt+5 -+5=Alt+6 -+6=Alt+7 -+7=Alt+8 -+8=Alt+9 -+9=Alt+0 -+ -+[Table/PrevPage] -+0=Up -+1=Page_Up -+ -+[Table/NextPage] -+0=Down -+1=Page_Down -diff --git a/tables/zlm.txt b/tables/zlm.txt -new file mode 100644 -index 0000000..529811e ---- /dev/null -+++ b/tables/zlm.txt -@@ -0,0 +1,66 @@ -+Length=20 -+KeyCode=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,.?!1234567890()"!:;#/'~-_` -+[Data] -+.  -+h  -+p  -+t  -+k  -+f  -+l  -+s  -+c  -+m  -+x  -+b  -+d  -+g  -+v  -+r  -+z  -+j  -+n  -+q  -+w  -+a  -+e  -+i  -+o  -+u  -+y  -+H  -+P  -+T  -+K  -+F  -+L  -+S  -+C  -+M  -+X  -+B  -+D  -+G  -+V  -+R  -+Z  -+J  -+N  -+Q  -+W  -+A  -+E  -+I  -+O  -+U  -+Y  -+'  -+,  -+~  -+`  -+_  -+-  -+1  -+2  -+3  -+4  diff --git a/extra/keyboard/symbols b/extra/keyboard/symbols new file mode 100644 index 00000000..0fdbc39c --- /dev/null +++ b/extra/keyboard/symbols @@ -0,0 +1,172 @@ +// German Neo-Layout Version 2 +// adopted 2004 by Hanno Behrens +// inspired by Dvorak/de-ergo http://www.goebel-consult.de/de-ergo/ +// +// Authors: Stephan Hilb +// +// Benjamin Kellermann +// Erik Streb +// and many other contributors +// +// https://www.neo-layout.org + +partial alphanumeric_keys modifier_keys keypad_keys +xkb_symbols "neo_zlr_base" { + + // The different layers and how to reach them + // -------------------------------------------------------------- + // Ebene 1: normal + // Ebene 2: Shift + // Ebene 3: Caps or Bksl ("Mod three") + // Ebene 4: Lsgt or RAlt ("Mod four") (for selecting, use also Shift) + // Ebene 5: Shift + Caps/Bksl + // Ebene 6: Caps/Bksl + Lsgt/RAlt + // Locking uppercase: left Shift + right Shift + // Locking Ebene 4: Shift + Caps + Tab, or Lsgt + RAlt + + + // Captions for the large table below + // -------------------------------------------------------------- + // Xorg: Level1 Level2 Level3 Level4 Level5 Level6 Level7 Level8 + // Neo: Ebene1 Ebene2 Ebene3 Ebene5 Ebene4 Pseudo-Ebene Ebene6 + // Access key: none Shift Caps/Bksl Shift + Caps/Bksl Lsgt/RAlt Shift + Lsgt/RAlt Caps/Bksl + Lsgt/RAlt + + + // Alphanumeric-keys + // ================= + key.type[Group1] = "EIGHT_LEVEL_WITH_LEVEL5_LOCK"; + + // The Tab key has Compose on the third layer (Caps + Tab) + // -------------------------------------------------------------- + key { [ Tab, ISO_Left_Tab, Multi_key, ISO_Level5_Lock, NoSymbol, NoSymbol, NoSymbol, ISO_Level5_Lock ] }; + + // Number row + // -------------------------------------------------------------- + key { [ dead_circumflex, dead_caron, U21BB, U02DE, dead_abovedot, Pointer_EnableKeys, dead_belowdot, NoSymbol ] }; + + key { [ 1, UED8B, onesuperior, onesubscript, ordfeminine, NoSymbol, notsign, NoSymbol ] }; + key { [ 2, UED8C, twosuperior, twosubscript, masculine, NoSymbol, logicalor, NoSymbol ] }; + key { [ 3, UED8D, threesuperior, threesubscript, numerosign, NoSymbol, logicaland, NoSymbol ] }; + key { [ 4, UED8E, U203A, femalesymbol, NoSymbol, NoSymbol, U22A5, NoSymbol ] }; + key { [ 5, guillemotleft, U2039, malesymbol, periodcentered, NoSymbol, U2221, NoSymbol ] }; + key { [ 6, dollar, cent, U26A5, sterling, NoSymbol, U2225, NoSymbol ] }; + + key { [ 7, EuroSign, yen, U03F0, currency, NoSymbol, rightarrow, NoSymbol ] }; + key { [ 8, doublelowquotemark, singlelowquotemark, U27E8, Tab, ISO_Left_Tab, U221E, NoSymbol ] }; + key { [ 9, leftdoublequotemark, leftsinglequotemark, U27E9, KP_Divide, KP_Divide, variation, NoSymbol ] }; + key { [ 0, rightdoublequotemark, rightsinglequotemark, zerosubscript, KP_Multiply, KP_Multiply, emptyset, NoSymbol ] }; + + key { [ UED9B, UED99, NoSymbol, U2011, KP_Subtract, KP_Subtract, hyphen, NoSymbol ] }; + key { [ dead_grave, dead_cedilla, dead_abovering, dead_dasia, dead_diaeresis, NoSymbol, dead_macron, NoSymbol ] }; + + // Top row + // -------------------------------------------------------------- + key.type[Group1] = "EIGHT_LEVEL_ALPHABETIC_WITH_LEVEL5_LOCK"; + key { [ UED88, UED88, ellipsis, Greek_xi, Prior, Prior, Greek_XI, NoSymbol ] }; + key { [ UED93, UED93, underscore, NoSymbol, BackSpace, BackSpace, radical, NoSymbol ] }; + key { [ UED84, UED84, bracketleft, Greek_lambda, Up, Up, Greek_LAMBDA, NoSymbol ] }; + key { [ UED86, UED86, bracketright, Greek_chi, Delete, Delete, U2102, NoSymbol ] }; + key { [ UEDAB, UEDAB, asciicircum, Greek_omega, Next, Next, Greek_OMEGA, NoSymbol ] }; + + key { [ UED82, UED82, exclam, Greek_kappa, exclamdown, NoSymbol, multiply, NoSymbol ] }; + key { [ UED8A, UED8A, less, Greek_psi, KP_7, KP_7, Greek_PSI, NoSymbol ] }; + key { [ UED92, UED92, greater, Greek_gamma, KP_8, KP_8, Greek_GAMMA, NoSymbol ] }; + key { [ UED83, UED83, equal, Greek_phi, KP_9, KP_9, Greek_PHI, NoSymbol ] }; + key { [ UEDAA, UEDAA, ampersand, U03D5, KP_Add, KP_Add, U211A, NoSymbol ] }; + + key { [ UEDA9, U1E9E, U017F, Greek_finalsmallsigma, U2212, NoSymbol, jot, NoSymbol ] }; + + key.type[Group1] = "EIGHT_LEVEL_WITH_LEVEL5_LOCK"; + key { [ dead_acute, dead_tilde, dead_stroke, dead_psili, dead_doubleacute, NoSymbol, dead_breve, NoSymbol ] }; + + // Middle row + // -------------------------------------------------------------- + key.type[Group1] = "EIGHT_LEVEL_ALPHABETIC_WITH_LEVEL5_LOCK"; + key { [ UEDA4, UEDB4, backslash, NoSymbol, Home, Home, includedin, NoSymbol ] }; + key { [ UEDA2, UEDB2, slash, Greek_iota, Left, Left, integral, NoSymbol ] }; + key { [ UEDA0, UEDB0, braceleft, Greek_alpha, Down, Down, U2200, NoSymbol ] }; + key { [ UEDA1, UEDB1, braceright, Greek_epsilon, Right, Right, U2203, NoSymbol ] }; + key { [ UEDA3, UEDB3, asterisk, Greek_omicron, End, End, elementof, NoSymbol ] }; + + key { [ UED85, UED85, question, Greek_sigma, questiondown, NoSymbol, Greek_SIGMA, NoSymbol ] }; + key { [ UED97, UED97, parenleft, Greek_nu, KP_4, KP_4, U2115, NoSymbol ] }; + key { [ UED94, UED94, parenright, Greek_rho, KP_5, KP_5, U211D, NoSymbol ] }; + key { [ UED81, UED81, minus, Greek_tau, KP_6, KP_6, partialderivative, NoSymbol ] }; + key { [ UED91, UED91, colon, Greek_delta, KP_Separator, comma, Greek_DELTA, NoSymbol ] }; + + key { [ UEDA5, UEDB5, at, Greek_upsilon, period, KP_Decimal, nabla, NoSymbol ] }; + + // Bottom row + // -------------------------------------------------------------- + key { [ UEDA7, UEDB7, numbersign, NoSymbol, Escape, Escape, union, NoSymbol ] }; + key { [ UEDA8, UEDB8, dollar, U03F5, Tab, Tab, intersection, NoSymbol ] }; + key { [ UEDA6, UEDB6, bar, Greek_eta, Insert, Insert, U2135, NoSymbol ] }; + key { [ UED80, UED80, asciitilde, Greek_pi, Return, Return, Greek_PI, NoSymbol ] }; + key { [ UED95, UED95, grave, Greek_zeta, Undo, Redo, U2124, NoSymbol ] }; + + key { [ UED90, UED90, plus, Greek_beta, colon, NoSymbol, U21D0, NoSymbol ] }; + key { [ UED87, UED87, percent, Greek_mu, KP_1, KP_1, ifonlyif, NoSymbol ] }; + key.type[Group1] = "EIGHT_LEVEL_WITH_LEVEL5_LOCK"; + key { [ UED98, comma, quotedbl, U03F1, KP_2, KP_2, U21D2, NoSymbol ] }; + key { [ UED89, period, apostrophe, U03D1, KP_3, KP_3, U21A6, NoSymbol ] }; + key.type[Group1] = "EIGHT_LEVEL_ALPHABETIC_WITH_LEVEL5_LOCK"; + key { [ UED96, UED96, semicolon, Greek_theta, semicolon, NoSymbol, Greek_THETA, NoSymbol ] }; + + // Space key + // -------------------------------------------------------------- + key.type[Group1] = "EIGHT_LEVEL_WITH_LEVEL5_LOCK"; + key { [ space, space, space, nobreakspace, KP_0, KP_0, U202F, NoSymbol ] }; + + + // Keypad-keys + // =========== + + // The former Numlock key: + key { [ Tab, ISO_Left_Tab, equal, approxeq, notequal, Pointer_EnableKeys, identical, NoSymbol ] }; + + // Topmost row + // -------------------------------------------------------------- + key { [ KP_Divide, KP_Divide, division, U2300, U2044, NoSymbol, U2223, NoSymbol ] }; + key { [ KP_Multiply, KP_Multiply, U22C5, U2299, multiply, NoSymbol, U2297, NoSymbol ] }; + key { [ KP_Subtract, KP_Subtract, U2212, U2296, U2216, NoSymbol, U2238, NoSymbol ] }; + + // Top row + // -------------------------------------------------------------- + key { [ KP_7, U2714, U2195, U226A, KP_Home, KP_Home, upstile, NoSymbol ] }; + key { [ KP_8, U2718, uparrow, intersection, KP_Up, KP_Up, U22C2, NoSymbol ] }; + key { [ KP_9, dagger, U20D7, U226B, KP_Prior, KP_Prior, U2309, NoSymbol ] }; + key { [ KP_Add, KP_Add, plusminus, U2295, U2213, NoSymbol, U2214, NoSymbol ] }; + + // Middle row + // -------------------------------------------------------------- + key { [ KP_4, club, leftarrow, includedin, KP_Left, KP_Left, U2286, NoSymbol ] }; + key { [ KP_5, EuroSign, colon, U22B6, KP_Begin, KP_Begin, U22B7, NoSymbol ] }; + key { [ KP_6, U2023, rightarrow, includes, KP_Right, KP_Right, U2287, NoSymbol ] }; + + // Bottom row + // -------------------------------------------------------------- + key { [ KP_1, diamond, U2194, lessthanequal, KP_End, KP_End, downstile, NoSymbol ] }; + key { [ KP_2, heart, downarrow, union, KP_Down, KP_Down, U22C3, NoSymbol ] }; + key { [ KP_3, U2660, U21CC, greaterthanequal, KP_Next, KP_Next, U230B, NoSymbol ] }; + key { [ KP_Enter, KP_Enter, KP_Enter, KP_Enter, KP_Enter, KP_Enter, KP_Enter, NoSymbol ] }; + key { [ KP_Equal, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol ] }; + + // Bottommost row + // -------------------------------------------------------------- + key { [ KP_0, U2423, percent, U2030, KP_Insert, KP_Insert, U25A1, NoSymbol ] }; + key { [ KP_Separator, period, comma, minutes, KP_Delete, KP_Delete, seconds, NoSymbol ] }; +}; + +partial alphanumeric_keys modifier_keys keypad_keys +xkb_symbols "neo_zlr" { + + include "de(neo_zlr_base)" + + name[Group1]= "Lojban (Neo 2)"; + + include "shift(both_capslock)" + include "level3(caps_switch)" + include "level3(bksl_switch)" + include "level5(lsgt_switch_lock)" + include "level5(ralt_switch_lock)" +};