Skip to content

Instantly share code, notes, and snippets.

@itsHanibee
Last active February 26, 2025 05:25
Show Gist options
  • Save itsHanibee/6bdbe6b298592ec210b48d7e8258f3f5 to your computer and use it in GitHub Desktop.
Save itsHanibee/6bdbe6b298592ec210b48d7e8258f3f5 to your computer and use it in GitHub Desktop.
a keyboard layout for xkb to type out runes. (made for personal use so if you'd like to extend this then please fork and credit the original)
default partial alphanumeric_keys
xkb_symbols "basic" {
include "us(basic)"
include "level3(ralt_switch)"
// Layer Shifting (Taking A (AC01) as an example)
// No Modifier = ᚨ
// Shift + A = ᚩ
// RAlt + A = ᚬ
// Shift + RAlt = ᚭ
name[Group1] = "Runic";
key <AD01> { [ U16A6 ] }; // Q: ᚦ
key <AD02> { [ U16B9 ] }; // W: ᚹ
key <AD03> { [ U16D6 ] }; // E: ᛖ
key <AD04> { [ U16B1 ] }; // R: ᚱ
key <AD05> { // T: ᛏ/ᛐ
type = "FOUR_LEVEL",
symbols[Group1] = [ U16CF, NoSymbol, NoSymbol, U16D0 ]
};
key <AD06> { [ U16C7 ] }; // Y: ᛇ
key <AD07> { // U: ᚢ/ᚣ
type = "FOUR_LEVEL",
symbols[Group1] = [ U16A2, U16A3, NoSymbol, NoSymbol ]
};
key <AD08> { [ U16C1 ] }; // I: ᛁ
key <AD09> { [ U16DF ] }; // O: ᛟ
key <AD10> { [ U16C8 ] }; // P: ᛈ
key <AC01> { // A: ᚨ/ᚩ/ᚬ/ᚭ
type = "FOUR_LEVEL",
symbols[Group1] = [ U16A8, U16A9, U16AC, U16AD ]
};
key <AC02> { // S: ᛊ/ᛋ/ᛌ
type = "FOUR_LEVEL",
symbols[Group1] = [ U16CA, U16CB, NoSymbol, U16CC ]
};
key <AC03> { [ U16DE ] }; // D: ᛞ
key <AC04> { [ U16A0 ] }; // F: ᚠ
key <AC05> { [ U16B7 ] }; // G: ᚷ
key <AC06> { // H: ᚺ/ᚻ/ᚼ/ᚽ
type = "FOUR_LEVEL",
symbols[Group1] = [ U16BA, U16BB, U16BC, U16BD ]
};
key <AC07> { // J: ᛃ/ᛄ/ᛅ/ᛆ
type = "FOUR_LEVEL",
symbols[Group1] = [ U16C3, U16C4, U16C5, U16C6 ]
};
key <AC08> { // K: ᚴ/ᚵ/ᚶ
type = "FOUR_LEVEL",
symbols[Group1] = [ U16B2, U16B3, U16B4, NoSymbol ]
};
key <AC09> { [ U16DA ] }; // L: ᛚ
key <AB01> { // Z: ᛉ/ᛦ/ᛧ
type = "FOUR_LEVEL",
symbols[Group1] = [ U16C9, NoSymbol, U16E6, U16E7 ]
};
key <AB02> { // X: ᛜ/ᛝ
type = "FOUR_LEVEL",
symbols[Group1] = [ U16DC, U16DD, NoSymbol, NoSymbol ]
};
key <AB03> { // C: ᚪ/ᚫ
type = "FOUR_LEVEL",
symbols[Group1] = [ U16AA, U16AB, NoSymbol, NoSymbol ]
};
key <AB04> { // V: ᛠ/ᛡ
type = "FOUR_LEVEL",
symbols[Group1] = [ U16E0, U16E1, NoSymbol, NoSymbol ]
};
key <AB05> { // B: ᛒ/ᛓ
type = "FOUR_LEVEL",
symbols[Group1] = [ U16D2, NoSymbol, NoSymbol, U16D3 ]
};
key <AB06> { // N: ᚾ/ᚿ
type = "FOUR_LEVEL",
symbols[Group1] = [ U16BE, NoSymbol, NoSymbol, U16BF ]
};
key <AB07> { // M: ᛘ/ᛙ/ᛚ
type = "FOUR_LEVEL",
symbols[Group1] = [ U16D7, NoSymbol, U16D8, U16D9 ]
};
// Punctuation keys with fourth-layer runes
key <AC10> { // ;/:/᛭
type = "FOUR_LEVEL",
symbols[Group1] = [ semicolon, colon, U16ED, NoSymbol ]
};
key <AB08> { // ,/</᛫
type = "FOUR_LEVEL",
symbols[Group1] = [ comma, less, U16EB, NoSymbol ]
};
key <AB09> { // ./>/᛬
type = "FOUR_LEVEL",
symbols[Group1] = [ period, greater, U16EC, NoSymbol ]
};
};
@itsHanibee
Copy link
Author

Install instructions:

  1. The above layout file goes in /usr/share/X11/xkb/symbols/
  • It's a write protected folder by default so cd there in your terminal and create a new file with sudo and call it runic
  1. Now we have to update the Layout list at /usr/share/X11/xkb/rules/evdev.xml
  • Open the file with sudo and follow the instructions carefully.
  • Find the <layoutList> section of the file and go down to the last entry in the nest. It should be the user-defined custom layout section. We will create a new one for ours right above so we are the second-to-last in the list. It should look like so.
    Screenshot_20250216_164325

Pasting the entry here so you'll have an easier time copying it.

    <layout>
      <configItem>
        <name>runic</name>
        <shortDescription>Runic</shortDescription>
        <description>Custom Runic Keyboard Layout</description>
        <languageList>
          <iso639Id>run</iso639Id>
        </languageList>
      </configItem>
      <variantList/>
    </layout>

Once that's done you should be good to go!

Here's a preview of the layout:
image

@itsHanibee
Copy link
Author

Be sure to restart your system once and on KDE Plasma you can go to Keyboard > Layouts to add the new layout
image

@itsHanibee
Copy link
Author

itsHanibee commented Feb 17, 2025

Updated it! (1.0 -> 1.1)

  • Moved Ȳr to the shift state of Ūruz
  • Moved Ēar so it's the base state corresponding to Īor
  • Gave Æsc its own binding as the shift state of Āc
  • Made it more readable so you'll have an easier time modifying it

Preview:
image

@itsHanibee
Copy link
Author

Updated it! (1.1 -> 1.2)

We are now feature complete!

  • RAlt layer now has runic single, double and cross punctuations.
  • New shift state
    • Shift+RAlt now hosts short-twig forms of Younger Futhark where applicable.

Preview:

image

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