set up my own keyboard layout which is now up and running… from my notes.
## SPECIAL CHARACTERS ##
# typing special characters into documents, text boxes, or terminals are done several ways.
# choosing them from the emoji selector or kcharselect GUI is fine for occasional needs.
# slightly more convenient is to use the Compose key + 1-4 letter code to generate them.
# to see what compose codes are, you can look them up based on your locale... for me, that's
/usr/share/X11/locale/en_US.UTF-8/Compose
# but, by far the most convenient method is to use the ISOshift (AltGr) key to access the
# 3rd and 4th layers of characters that your keyboard layout can support.
#
# the standard US layout does not provide anything for these extra two layers, but there
# are variants that do, and English (US, Symbolic) provides greek letters with some symbols.
#
# settings > input devices > Advanced has the Compose and 3rd layer shift key choices
# like R_CTRL for compose and R_ALT for ISOshift, along with layout and variant
# selections... this plasma GUI tool saves all of it's settings in
~/.config/kxkbrc
# if your keyboard layout and variant choice has all the special characters you need
# easy access to then you can stop reading... and if you still need more and find
# other layouts and variants with them, your GUI keyboard layout settings can be
# used to switch between multiple layouts and variants as needed.
#
# but if you need access to characters that are not already included or if your
# GUI settings becomes inoperable and you only have access a single variant, then
# a custom layout may be needed to keep all the characters in one place for easy access.
# if the plasma GUI settings gets broken the system will ignore the settings file
# and the following command line utility can be used to set the configuration of the
# Compose key and ISOshift key choices for accessing the special characters.
sudo dpkg-reconfigure keyboard-configuration
# however, if the layout and variant settings from that command are also ignored,
# then in order to set the default layout after each reboot, use root to edit this file.
/etc/X11/xorg.conf.d/00-keyboard.conf
# temporary changes to the keyboard layout and variant can also be made on the fly
# if you know the layout and variant name using this command
setxkbmap <layout> <variant>
# layouts are stored in the following directory under the country's two letter code (us)
/usr/share/X11/xkb/symbols
# and within each layout there will be variants defined by lines that say
xkb_symbols "<variant>"
# these files support the include syntax so tweaks can be made to existing definitions
# allowing for easy changes to a single key, or set of keys as desired.
# under each of these definitions there are key codes for individual keys such as <AD05>
# which is the row D (4th from bottom) key in the 5th position from the left (the T key)
# after, on each line, are keysym definitions, separated by commas, and enclosed by {[]}
# these positions correspond to the following: {[key, shift+key, ISOkey, shift+ISOkey]}
# the keysym can be a key (T), a unicode without the +sign (U262E), or the keysym name
# (plusminus) as defined in a file called keysymdef.h which can usually be found in
/usr/include/X11/keysymdef.h
# using VoidSymbol or leaving the keysym blank means the key press will produce nothing
# the special word NoSymbol is used when an existing keysym is not to be changed
# to make your own custom keyboard layout try to find an existing one that comes as close
# to what you want as practical. you can use the preview function in the settings GUI to
# get a graphic of what all the key definitions are set to for that keyboard layout.
#
# when you find one that comes close, then note the counrty and variant name, and
# open that file from the symbols directory. there you can search for the variant
# name to find the relevant block of key definitions. it may be that an include
# statement is bringing in most of the key definitions so, in that case you may want to
# search for the variant called out in the include statement (might be a different file).
#
# once you have found the keys or block of keys you want to customize just copy and
# paste them into a new document along with the section header and closing semicolon
# like as shown below, and proceed to make your edits to the keysym values.
partial alphanumeric_keys
xkb_symbols "symbolic-geek" {
include "us(symbolic)"
name[Group1]= "English (US, Symbolic-Greek and Geek)";
key <TLDE> { [ NoSymbol, NoSymbol, U2241, approxeq ] }; // ` ~ ≁ ≈
key <AE01> { [ NoSymbol, NoSymbol, U220E, because ] }; // 1 ! ∎ ∵
key <AE11> { [ NoSymbol, NoSymbol, emdash, endash ] }; // - _ — –
key <AE12> { [ NoSymbol, NoSymbol, notequal, plusminus ] }; // = + ≠ ±
key <AD01> { [ NoSymbol, NoSymbol, U21D1, U21D3 ] }; // q Q ⇑ ⇓
key <BKSL> { [ NoSymbol, NoSymbol, U1F6C7, brokenbar ] }; // \ | 🛇 ¦
key <AC01> { [ NoSymbol, NoSymbol, Greek_alpha, U2659 ] }; // a A α ♙
key <AC10> { [ NoSymbol, NoSymbol, uparrow, downarrow ] }; // ; : ↑ ↓
key <AB01> { [ NoSymbol, NoSymbol, Greek_zeta, U0277 ] }; // z Z ζ ɷ
key <AB10> { [ NoSymbol, NoSymbol, U262E, U262D ] }; // / ? ☮ ☭
include "level3(ralt_switch)"
};
# in this example the variant name will be symbolic-geek and is what you would use when
# manually editing the 00-keyboard.conf file, or using setxkbmap.
#
# the definition includes us(symbolic) which is the symbolic variant inside the us file.
# it then names the keyboard layout as it would appear in the GUI settings.
#
# what follows is a list of key definitions where only the ISO and shifted ISO
# key characters are being redefined, while the un-shifted and shifted characters remain
# unchanged by using the NoSymbol code, from what is shown in the symbolic variant.
#
# the level3(ralt_switch) is the key selected for accessing the 3rd and 4th levels
#
# the easiest way to incorporate this layout is to simply append it to the end of the
# existing us keyboard layout... but before doing that it is recommended to make a copy
cp /usr/share/X11/xkb/symbols/us /usr/share/X11/xkb/symbols/us-bak
# in case you need to restore the existing us keyboard layout for any reason.
#
# now open the us file as root in a text editor of your choice and paste into it
# the contents of your new file with your new definitions, save and reboot.
#
# if you've done everything right you should find the keys have changed, and running
setxkbmap -print -query
# should show your chosen layout and variant as active.
# lastly, to see the new layout or variant listed in the settings GUI menus then
# add an entry for it to each of these files, copying the format of the layout
# or variant used as the starting point for the new one.
/usr/share/X11/xkb/rules/evdev.lst
/usr/share/X11/xkb/rules/evdev.xml
here is a preview of the keyboard layout crated from this effort