• You are not logged in.

DreymaR's Big Bag of Keyboard Tricks (Linux/XKB files included)!

  • Started by DreymaR
  • 234 Replies:
  • Reputation: 41
  • From: Bærum, Norway
  • Registered: 13-Dec-2006
  • Posts: 3,978
DREYMAR'S (XKB): DreymaR's Extensive Yet Modular ARSenal (for X KeyBoarding)

[CAVEAT EMPTOR: This work is under some long-term construction due to its complexity.
Almost all areas are now nicely domitable, but a hard-hat area or two may still be found.]

NOTE: This is the main Big Bag Of Keyboard Tricks topic, in which I go into detail on what the different tricks are.

I also have topics focusing on different implementations of the Big Bag Of Keyboard Tricks:
• The Big Bag for Linux using XKB (currently, this very topic!)
• The Big Bag for Windows using PKL
• The Big Bag for USB-2-USB remapping devices (QUICKIE) using TMK
• The Big Bag for Mac OS using Karabinier by mkborregaard (but not yet for MacOS Sierra?)


Since I started using Colemak in early 2007 I've been fiddling with it, trying out ideas from the forum and adding some of my own. Colemak per se is to me only the letter block mappings including the semicolon, and their shifted counterparts. I've always ended up with that intact and it has stood the test of time. If you look up the "ergo" mods below you'll see that I'm somewhat flexible about the geometry – but in reality that's about the physical keyboard design and a better hand position for me. The layout itself stays mostly the same!

My personal Colemak arsenal now includes several other enhancements:

        Character/Key Mapping Layers:
[1.1] Colemak[eD] AltGr mappings (lv3–4; dead keys on symbol keys etc)
[1.2] Extend layers using Caps Lock as a switch modifier for navigation/editing/browsing/etc from near the home position
[1.3] Several Dead key enhancements giving access to lots of glyphs (presently for Windows/PKL only)

        Ergonomic Key Remappings:
[2.1] Angle/Wide ergo modifications to improve wrist angles, hand spacing and right pinky stretch/load effort
[2.2] The Colemak Curl(DH) ergo mod (deprioritize middle columns without keys changing fingers)
[2.3] Modifier modness (Work In Progress)

        Other Layouts:
[3.1] Tarmak transitional Colemak layouts for learning Colemak in smaller steps if so desired
[3.2] For several locales, a 'Unified Symbols' layout with only a few necessary changes from standard Colemak[eD]
         Also, a layout to 'Keep Local Symbols' like their default (QWERTY-type) counterparts and key cap markings for that locale
[3.3] Intuitive Cyrillic, Greek and Hebrew Colemak phonetic layouts to write other scripts (e.g., using a toggle switch key)
[3.4] Mirrored Colemak, allowing one-handed typing without extra learning

        Download and Setup:
[4.1] Download and Install files for X11 XKB for Linux
[4.2] XKB configuration
[4.3] XKB notes and terms
[–.–] Notes/Done/Todo

        Other Typing Tricks:
[5.1] Hardware USB-2-USB remapping devices (QUICKIE)
[5.2] Colemakoid MessagEase layouts for touch screen typing
[5.3] Amphetype for typing training
[5.4] The Typing of the Dead for ultra-cheesy-violent typing gaming
[5.5] Physical keyboard modding

I use Farkas Máté's excellent Portable Keyboard Layout ('PKL') to achieve most of the above for Windows but over the last years I've been using Linux (Ubuntu and others) more and more. So I hacked up a bunch of modifications to the X.Org XKB files. I'm pretty proud of it, I must say! :)

I've posted topics for discussing some of the modifications on their own, but here is the whole shebang in one place for Linux users!

An advantage with my implementation is that you can pick and choose most of the enhancements as modules:
• The Angle/Wide mods are keyboard models so they work with any layout you choose (including QWERTY or Dvorak ones) and may be chosen per user
• The Extend layers and their switch key are xkb "options" and should work with nearly any existing layout
• The locale/phonetic, Mirrored and Tarmak layouts are separate layouts that may use various chooser keys as desired.
Freedom of choice through modularity is an ideal in the DreymaR world, as it is in Linux.


See the main Colemak[eD] topic if you're interested.

This is my own preferred AltGr mapping layers (modifier lv3-4 in Linux terminology) for the Colemak layout. I've tried to add much functionality while keeping it intuitive. In particular, I want to be able to write different scripts and tech/maths symbols. Since the start, there's been some minor tweaks based on my experience and forum feedback, but it's been stable for a long time now.

See the xkb/symbols/colemak file for comments and explanations, in addition to these design goals:
- Keeping level 1-2 of Colemak intact! This is what I think of as the Colemak layout per se.
- Dead keys easily accessible as unshifted AltGr+symbol keys; common ones in good positions.
- Added letters/quotes allowing many of the major latin scripts to be written correctly.
- Added symbols/glyphs similar to, e.g., Mac ones - allowing common math/tech/etc typing.
- The positions of added letters and symbols should as far as possible be easy to remember!

    The Colemak [edition DreymaR] layout, using different lv3-4 mappings from Shai's default Colemak.
    Shown on an ANSI keyboard with dead key emphasis (golden) and "FingerShui" color-coded proposed fingering.

    Colemak-CAW[eD], showing the Norwegian 'us' variant on an ISO board with the Curl(DH)Angle and Wide(/) ergonomic mods (see below).

• You can select the various layouts for different locales (see below) that all have my Colemak[eD] mappings, in the standard layout chooser
• I often type 'colemak' or the language name into the search field to narrow down the search
• Alternatively, you may use a 'setxkbmap' terminal command such as 'setxkbmap -layout "us(cmk_ed_us)" -v 9' (or see below about my scripts)


This is my favorite mod next to Colemak itself! The ability to navigate and edit from the home position and its immediate surroundings is extremely powerful. It's like having part of the power of advanced editors like Vim ready in all situations. Plus a fully functional multimedia keyboard without sacrificing compactness. And more.

From my source file:

A modular Extend mapping layer like the one I have in Portable Keyboard Layout for Windows
- Key names are in /usr/include/X11/keysymdef.h and XF86keysym.h (Removing the XK_ prefix)
- <FK##> mapped as XF86 Multimedia keys; shifted versions were not implemented in WinPKL

These keys are modified/transposed by holding down the 'extend key' (CapsLock by default):
|Esc + |F1 <> |F2 << |F3 >> |F4 <> |F5 <> |F6 << |F7 >> |F8 <> |F9 <> |F10<> |F11<> |F12<> |
|      | Pause| Rew  | Fwd  | Eject| Refr | Bri- | Bri+ | Sleep| WWW  | Mail | App1 | App2 |
| Caps | Play | Prev | Next | Stop | Mute | Vol- | Vol+ | Media| Home | Srch | File | Calc |
|` €€€ |1     |2     |3     |4     |5     |6     |7     |8     |9     |0     |-     |=     |
| Cust | F1   | F2   | F3   | F4   | F5   | F6   | F7   | F8   | F9   | F10  | F11  | F12  |
|Tab   |Q €€€ |W *** |F <<> |P <>> |G *** |J ### |L ### |U ### |Y ### |; €€€ |[ €€€ |] €€€ |
|      | Esc  | *WhUp| BrBck| BrFwd| *MUp | PgUp | Home | Up   | End  | Del  | Esc  | Ins  |
|Caps+ |A +++ |R *** |S +++ |T +++ |D *** |H ### |N ### |E ### |I ### |O €€€ |' €€€ |\ ><> |
| ++++ | Alt  | *WhDn| Shift| Ctrl | *MDn | PgDn | Left | Down | Right| Back | Menu | BrFav|
|_ *** |Z €€€ |X === |C === |V === |B *** |K *** |M *** |, *** |. *** |/ €€€ |Spc € |Entr€ |
| *MOn | Undo | Cut  | Copy | Paste| *Bt1 | *Bt2 | *Bt3 | *MLe | *MRi | Multi| Enter| PrtSc|
Legend: # Movement; + Modifiers; = GUI edit; * Mouse; <> MultiMedia; € Various commands.

Hitting Caps+<LSGT> (or Shift+NumLock if that's enabled) enables/disables Pointer Mousing; when that's on you may move the mouse pointer with the GD<> keys and use BKM for buttons (or you can use the KeyPad keys as before). My mapped keys go a few pixels at a time so when acceleration is on you may travel quickly around the screen this way. Wheel mousing works but doesn't repeat so you'll have to press many times to scroll a long way.

The multimedia keys are mapped to the F keys (++) as intended but XKB/Linux doesn't necessarily link any actions to their key presses although these days most of the usual multimedia keys are configured as expected; this is done in the Shortcuts settings which can be accessed in Unity/Gnome via the Keyboard settings (or dconf-editor/gsettings to org.gnome.desktop.wm.keybindings for the Window Manager ones and ??? for other categories). You could also use xbindkeys, AutoKey or others to bind whatever you want to these keys.

Using the Settings > Keyboard panel in Unity/Gnome (gnome-control-center keyboard) doesn't work as expected with the Extend mapped keys, since the hotkey will register as a 'Level 5 shift' keypress when you press your Extend key! The trick is to press the modifier(s) before clicking on the shortcut you want to set! Then when 'New accelerator' is showing you press down the final key. I had to do that for the Calculator and Terminal keys (Lv5+<FK12>) as those shortcuts were disabled by default in my Ubuntu install.

    A symbolic chart of my Extend mappings (lvl1 only). Greens, navigation; blue/circled, mousing; orange, multimedia; gray, system/misc.

The XKB implementation is almost the same as the Windows/PKL one. You get shifted multimedia keys which Win/PKL couldn't support, but not mouse WheelLeft/Right scroll keys as those are poorly implemented. Instead, there's a MouseKeys On/Off key on <LSGT> and a Compose/Multi key on Slash. Those should be fairly useful I think. The Tilde key is customizeable – by default it holds a spare Del but it could be anything you deem useful.

Holding down AltGr you get a NumPad layer (lv7-8) laid out pretty much like a standard one (but with the top row moved around to fit existing keys):

// KeyPad overlay with nav block to the left (lv7-8):
// +------+------+------+------+------+------+------+------+------+------+------+------+------+
// |` €€€ |1     |2     |3     |4 £   |5 €   |6     |7     |8  ⇑  |9     |0     |-     |=     |
// | Cust |  !   |  @   |  #   |  $   |  %   |  ^   | KP_7 | KP_8 | KP_9 | KP_* | KP_- | KP_= |
// +------+------+------+------+------+------+------+------+------+------+------+------+------+
// |Tab   |Q ### |W ### |F ### |P €€€ |G €€€ |J ### |L     |U     |Y     |;     |[ {   |] }   |
// |      | Home | Up   | End  | Del  | Esc  | PgUp | KP_4 | KP_5 | KP_6 | KP_+ |  (   |  )   |
// +------+------+------+------+------+------+------+------+------+------+------+------+------+
// |Caps+ |A ### |R ### |S ### |T €€€ |D     |H ### |N     |E  ⇓  |I     |O     |' "   |\ |   |
// | ++++ | Left | Down | Right| Back | K_Lck| PgDn | KP_1 | KP_2 | KP_3 | K_Ent|  '   |  :   |
// +------+------+------+------+------+------+------+------+------+------+------+------+------+
// |_ *** |Z €€€ |X === |C === |V === |B *** |K     |M     |,  ⇕  |.     |/     |Spc   |Entr  |
// | *MOn | Undo | Cut  | Copy | Paste| *Bt1 |  ,   | KP_0 | KP_0 | KP_. | KP_/ | Spc  | K_Ent|
// +------+------+------+------+------+------+------+------+------+------+------+------+------+

Having to hold down both CapsLock and AltGr while entering numbers is hardly ideal. I'd like to use another key (but there are few to spare) and maybe make it a lock instead of a switch modifier (i.e., one you have to hold down). Unsure about that, really. But at least, here it is. Actually, one might construct a level7 modifier by combining level3 with level5.

There may be a need for navigating while entering numbers, but on the other hand KeyPad keys rarely use modifiers. So I moved the nav block from its UNEI arrow cross to the WARS cross familiar to gamers. Number row keys 1-6 are reverted to their lv2-3 symbols since these may be needed for numeric input, as are some other keys; the bracket keys cater for the parentheses in this layer which feels logical to me.

If you're cheeky and dexterous enough to press CapsLock+AltGr+Shift at the same time, you're treated to a set of double-arrow symbols of the kind used in mathematical proofs and more (⇖⇑⇗ ⇐⇔⇒ ⇙⇓⇘), laid out like in one of the standard xkb keypad layouts. I thought they might be somewhat handy, but the heavy chording required suits the fact that few need them very often! The single arrows didn't fit in, but at least the four orthogonal ones (←↑↓→) are already there in the lv3-4 Colemak[eD] mappings.

All KeyPad keys are affected by PointerEnable! So if you find the mouse pointer moving around instead of numbers being entered, hit the key to disable pointer mousing (Shift+NumLock or CapsLock+LSGT). Or, you've found an extra way of key mousing! :-)

• The backtick/tilde key to the left of 1 can be whatever you want to: An extra Del, Ctrl+A (Select All), Ctrl+W (Close), Ctrl+T (New Tab), Win+T (Taskbar)...
• You can do some really fancy stuff with this! Ext-A/T+4(=Alt/Ctrl+F4) closes programs/tabs, Ext-T+J/H(=Ctrl+PgUp/PgDn) switches tabs...
• Or try this in a browser: Ext-6 for the address bar, then type an URL, then Ext-A+Spc to open it in a new tab (saves Ctrl+T for a new tab)!
• Most of these tricks work in many apps under both Windows and Linux these days. Some application specific ones are marked as such.
• My Extend layer doesn't support letters nor the Win/GUI key, which limits the shortcut repertoire somewhat. But even so there's really a lot you can do!
  (FYI: There are good reasons for the WheelUp/Dn placements and the lack of a Win key, having to do with keyboard implementations.)
• For more info and tricks, see my Extend Extra Extreme topic.

To get the Extend mappings to work in xkb, you need two things:
• Set the 'misc:extend' xkbmap option (see below under "installation"), and
• choose a modifier key to switch to level5; I've added a 'level5:caps_switch_lock' option to use the Caps key.
• There are others to choose from (lsgt, lalt, lwin and rwin) that were already available in xkb; you could even have more than one if you want!
• (By using several lv5 switch keys, the switch_lock behavior makes it possible to lock the Extend layer by pressing two modifiers together should you require that.)
• If you have the 'Options...' settings menu (Gnome has it), these options are under the 'Miscellaneous' and 'Level 5' headings.


For some reason, the Stroke dead key is still broken in my XKB. Gotta get that fixed at some point (maybe it'll be my first Linux bugfix unless someone beats me to it). Furthermore, I'd like to add more mappings that feel intuitive to me such as superscripts on the acute accent key and subscripts on the grave accent key.

Some dead keys are almost empty: The doubleacute only caters for ő ű, and ring only caters for å ů ẘ ẙ. There's also a whole iota dead key that only concerns itself with Greek characters. I'm tempted to stuff something good into those cracks even if it's not an entirely logical thing to do (because the name of the dead key wouldn't reflect these extra mappings). If you use up a key mapping on a dead key it really shouldn't sit there taking up keyboard space for the meager purpose of providing 2-3 glyphs!

Note: I think it's about the locales. The big en_US.UTF-8 Compose file has the dead_stroke key defined (and lots of other goodness!) so I should find out how to get that then. Defining my own ~/.XCompose file apparently involves setting the xim input method as the active one instead of a hard-compiled GTK one my Ubuntu must be using now I guess. It's a bit complex it seems... :o I'll be back on this issue when/if I find out more!


See for instance this topic by cevgar on Wide mods, and this topic by me on Angle mods.

Some have noted that these mods can really open up, say, a cramped notebook keyboard so much that it feels "bigger on the inside"! So maybe this slogan is suitable? ;-)
Typing Advancement: Row Displacement Increases Spaciousness (T.A.R.D.I.S.)
(Although technically, for the most part these mods displace half-rows. Bear with me.)

These are ergonomic mods, moving some keys around to achieve straight wrists (the Angle mods), as well as better hand separation and right pinky load (the Wide mods). The Angle part is almost a no-brainer to me as it allows the left hand to keep a straight wrist without changing the fingering on ZXCV, and makes B easier to reach. Colemak creator Shai himself has given his "blessing" to this mod! The Wide mod is more optional, but it does put some load off the right-hand pinky, widen the arm distance (useful for small keyboards in particular, but nice regardless), and provide easier access to AltGr/Enter/Backspace/RShift.

With a 102/105-key ISO keyboard the Angle mod is very smooth indeed, and I strongly recommend at least an Angle shift if you have an ISO keyboard! The US/ANSI solution is either to move the Z to the middle which is somewhat more dramatic, or to split the bottom row while shifting all the others to the right in a manouevre known as the 'A-Wing' (see below). Both have their points, so I really don't know which is better although all ANSI Angle modders I've heard of are using Angle(Z). With A-Wing, you'll not get the "wide" experience, and increased distance to Tab and LShift. With Angle(Z) and straight wrists, hitting LShift is actually rather nice!

When I use these I like to move the key caps around and make the change global - my family actually don't seem to mind as the changes are fairly intuitive and unintrusive, leastways for the run-of-the-mill keyboard user who looks at symbol key caps to find them. I got used to the changes quickly, too. But you can implement the change on a per-user basis if you wish. (If you do, take care with your logon dialogs and passwords!)

For Linux/xkb, the Angle/Wide mods are implemented as keyboard models. This means that you can use them with any layout including the QWERTY and Dvorak ones, Tarmak and even the Curl mods and Mirrored Colemak (because those are implemented as layouts). Modularity at your fingertips, again.

    The AngleWide-Slash wide ergo mod for PC105/ISO keyboards.

I've implemented the ZXCVB_ 'Angle' shift for ISO keyboards both separately and as part of the AngleWide(Slash) mod that I use myself. For ANSI boards I've made an implementation of the 'Angle(Z)' shift (moving the Z key to the middle) and a Wide(Quote) mod as well as the combination of these. Also the 'A-Wing' mod to get the Angle and right pinky benefits without messing with the Z position (at the cost of longer left pinky stretches).

     The Angle(Z)Wide ergo mod for PC104/ANSI keyboards

     The "A-Wing" ergo mod for PC104/ANSI keyboards

"There is another." I haven't implemented this ANSI Angle mod, but I will at least mention it. The trick is moving Z to the LShift key! LShift then needs a new home which should be better than the old B position. One solution is to move LShift to the Alt key and put Alt on the old B key. But this means moving modifiers around, so I'm a bit wary of it. Also, a fat Z key looks a bit odd, but if it works for you then all's fine! User stevep99 has some neat pages on layout mods where he lists this one.

Other names:
Many of these mods have been discussed under other names. So if you come across older posts here's a key to what we've been discussing:
• AngleWide is often abbreviated as AWide, and CurlAngleWide as CAW.
• The Curl(DH) mods have somewhat arcane longer names (DH=DvbgHmk, DHm=DvbgHm and DvH=DbgHk) which describe and distinguish them.
• I've named Wide mods after which key they put in the old Right Bracket position; as such, the one I use is AWide(/), AWide-Slash or Awide(35) mod.
• The A-Wing angle mod has been called Angle-Frame, A-Frame or AngleWing.
• I don't know any snappy names for the fat-Z mod. Well, except for Fat-Z which is kind of cool. ;-)

To use these, you might have to edit a file or so (see below under "Installation") unless your distro supports keyboard choice which Ubuntu used to do but doesn't anymore.
Otherwise, 'setxkbmap -model <name>' works on-the-fly. I use my setxkb.sh bash script (call it with '-h' or '-?' for more info, or see below).

The xkb ergonomic keyboard model mods are named as following:
• pc104angle-z – ANSI/US Angle mod, putting Z in the old B position
• pc104wide-qu - ANSI/US Wide mod, putting the Quote key in the old Right Bracket position
• pc104awide-zqu - ANSI/US AngleWide mod, combining the two mods above
• pc104aframe - ANSI/US A-Wing mod, splitting the bottom row and shifting the others
• pc105angle-lg - ISO/Euro Angle mod, putting <LSGT>/VK_102 in the old B position
• pc105awide-sl - ISO/Euro AngleWide mod, including Angle-LG and putting the Slash key in the old RBr position


See stevep99's Colemakmods page, as well as the main Colemak Mod-DH topic and links therein. Also, note my review of the Curl mods. Note, however, that we've since then agreed on one common Curl(DH) mod.

    The Colemak Curl(DH)Angle ergo modded layout.

The point of the Curl ergo mod is to make the home "row" curl more like a relaxed hand does instead of forcing it to a straight line as was commonly thought best some years ago. Several typists have felt that the middle-trench D and H positions of Colemak weren't so comfortable and as a result the Workman and Norman and other layouts were made. However, I don't think they succeeded on many other important facets (more keys moved, and/or more same-finger bigrams, and/or poorer performance on other stats). So the proposal by stevep99 to fix the issue based on Colemak and without any keys changing fingers was a stroke of genius! It's a low-cost improvement of the default straight-homerow Colemak. And I still think of it as Colemak because it really is, keeping its good stats for travel distances, finger usage and same-finger ratios.

The Curl mod has a few variants in addition to the standard one, notably Steve's original DHm (DvbgHm) mod which swaps the Colemak(Angle) D–V and H–M positions but leaves the K alone, and my old DvH (DbgHk) which instead swaps D–B and H–K while letting the M stay unchanged. The DHm mod is probably better if you have a non-staggered matrix board. I made the DvH mod to be less radical and intrusive as it doesn't move the V and M keys (apart from the Angle mod moving V with ZXC). However, I have now moved on to Curl-DH (DvbgHmk), in the name of unity and goodness. And I shall henceforth name it the Curl(DH) mod.

The Colemak Curl mod also puts the G key back to its old QWERTY position which more than offsets moving the less frequently used B. On the right hand side, at least one more key has to be moved compared to standard Colemak; the default mod moves two. But this cost returns a larger gain, as H moves to a better position.

If you type a lot in a language in which L is more common than H (including several latin and Nordic languages), it may be worth considering a further tweak in which L is moved down to the better position on the lower row and H gets whatever position you deem second-best. There have also been mod proposals for the Dutch who need a better J position. You'd have to implement these yourself for now.

The Curl mod depends on using an Angle mod which is easier on an "105-key"/ISO keyboard but there are decent options for "US"/ANSI boards too. If you want to learn this using the Tarmak progression described above, that's possible too! You just have to learn the Angle mod early on, and tweak the 2nd Tarmak step a little. The right-hand mod (Hmk, Hm or Hk) may be learnt whenever you feel like it as it's mostly separate from the rest of the layout from Tarmak1 onwards.

    My personal assessment of key position goodness (from green via blue to purple), using a straight-wrist, relaxed-fingers hand position.

I've dubbed my CurlAngleWide modded Colemak a Colemak-CAW! It's a Colemak at heart, but sufficiently modded that I wanted a snappy name for it. And yes, that's also a tip-of-the-hat to Billy Macaw in CATS. ;-)

• Note that for now, the Curl(DH) mod isn't 100% modular. You'll get it with the Colemak[eD] mappings for one, as AltGr mappings are intertwined with the mod.
• There are some selectable modded layouts under English (the 'us' locale):
    – us(cmk_ed_dh) – "English (Colemak[eD], Curl-DH ergo)"
    – us(cmk_ed_dhm) – "English (Colemak[eD], Curl-DH-matrix ergo)"
    – us(cmk_ed_dvh) – "English (Colemak[eD], Curl-Dbg/Hk ergo)"
• In addition, there are xkb options you can use with setxkbmap -option.
    – misc:cmk_curl_dh
    – misc:cmk_curl_dhm
    – misc:cmk_curl_dvh
    NOTE: These are ideal for most locale layouts, for instance. However, they overwrite and are overwritten by other layouts – even non-Colemak ones!
• If you wish a "harder" solution, you can edit the xkb/symbols/colemak file, uncommenting the mod lines you want (Dvbg/Dbg, Hm/Hk/Hmk).
    These are found in the xkb_symbols "cmk_ed_letters" partial, so they affect all locale variants, Tarmak etc. – but not non-Colemak layouts.
• Finally, the setxkb.sh script will accept several Curl-modded keyboard models. It'll reinterpret these as a combo of model and misc option, accordingly.
    – In the below, replace '##' with either 'dh' for the main Curl-DH mod, 'dm' for the DHm mod, or 'dv' for the DvH mod.
    – After the model names, shortstring codes for the models are listed; replace '#' with 'h' (for DH) or 'm' (for DHm) similarly
    – pc104[curla-##z/caw-##zqu/cawing-##] for the PC104(ANSI) CurlAngle(Z)/CurlAngle(Z)Wide(Qu)/CurlA-Wing "models" (short: 4# / 4#w / 4#f )
    – pc105[curla-##/caw-##sl] for the PC105(ISO) CurlAngle(LSGT)/CurlAngleWide(/) "models" (short: 5# / 5#w )
• Note: If you have a system (X11) directory install, you'll need sudo privileges to edit those files. (Make sure you use gksudo or similar if you start a GUI editor.)
• There are special tarmak2##_et layouts for dh/dm/dv, and tarmak1k_e layouts for the DH and DvH mods (see below for info about Tarmak).
• NOTE: If your locale variant remaps any of the affected keys (mainly D, G, H or K) you'll have to look up and edit that locale symbols file.

Example: Editing the symbols/colemak file
• Here I've uncommented two lines in the "cmk_ed_letters" section of xkb/symbols/colemak, thus activating both sides of the Curl-DH mod.
• This is useful for non-US layouts and Tarmak steps; otherwise you can just select the English Curl layouts as explained above.

//// NOTE: Including the line(s) below will enable the Curl-DH ergo mod; see below.
    include "colemak(cmk_dvbg_ed)"
    include "colemak(cmk_hmk_ed)"
//// NOTE: Including the line(s) below will enable the Curl-DHm mod by Stevep99; see below.
//    include "colemak(cmk_dvbg_ed)"
//    include "colemak(cmk_hm_ed)"
//// NOTE: This is the old, lighter Curl-DvH Colemak ergo mod, keeping V and M in place.
//    include "colemak(cmk_dbg_ed)"
//    include "colemak(cmk_hk_ed)"

Example: Using a CurlAngleWide "model" with setxkb.sh
• These two examples both activate the PC105-Curl(DH)AngleWide mod.
• The shortstring line will not change the active layout (apart from the Curl mod); the other line will use the setxkb.sh default layout.
• This is useful if you don't want to edit the files. Curl affects only the first/main layout, but will mess up any non-Cmk layouts in the GUI.

$> ./setxkb.sh -s 5dw
$> ./setxkb.sh -m pc105caw-dhsl
[2.3]    MODIFIER MODNESS (Work In Progress)

We've already encountered a modfied modifier above: The Extend key, which is usually the mostly unused CapsLock being put to far better use. In "vanilla" Colemak, this key is modded to a second Backspace.

In the Linux world, it's quite common to shuffle around the modifiers a bit. Caps can become Control, Esc or something else for instance.

stevep99 is a big fan of remapping in particular the Alt keys, since they're thumb keys which can be very ergonomic. He likes to put Extend and/or Shift on those keys. See his GitHub pages on ergonomic mods for more info.

I'm a little wary of modifier modding myself, as it can be hard to implement reliably across platforms. Sometimes keys don't play well together, possibly because of hardware limitations in the scan matrix of cheaper keyboards and possibly because an OS (or Java/Flash/etc) can get confused when a non-modifier key becomes one. I've had my share of troubles with the Extend-modifier keys (Ext+A/S/T for Alt/Shift/Ctrl). Another issue is the differences between keyboards when it comes to the position of particularly the Right Alt key, making it very convenient on some boards but not on others. I do believe you should use a keyboard with a good RAlt position. Note that the Wide mod helps a bit with that.

Another modifier mod is Sticky Shift. With this mod, which is available out-of-the-box in many OSes, you can tap a Shift (or Ctrl) key and then another key to released a shifted (or control) character. It's used by some of the fastest typists because with a chording Shift there's a higher risk of getting DOuble CApitals at high speeds. I find it quite pleasant to use.


There's a main forum topic on Tarmak that you may want to read. Basically, I've added four Tarmak layouts that provide stepping stones from the standard QWERTY layout to Colemak[eD] by moving only 3-4 keys per step. Each step brings at least one important key to the home row (notably, E-T-R-O-I) and only the rare J key is misplaced in the process.

Similar transitional layouts have been reported successful in easing the conversion to Colemak typing and although this evidence is anecdotal I find the proposed hypothesis that gradual changes should be easier to learn for many a plausible one.

    The 5-step Tarmak (transitional Colemak) layouts, spectrally color-coded from red (Tarmak#1) to violet (Colemak).

My xkb Tarmak files are all based on my standard Colemak[eD](US English) layout with no options for other lv3-4 mappings. They are learning aids anyway, so this shouldn't be much of a problem.

For the Mac/Win people: See the main Tarmak topic for some implementations.

• Entering "Tarmak" in the search field in the layout chooser should show the four Tarmak layouts from E (the first) to ETRO (the last step before Colemak)
• Using command line or default file, they're called:
    us(tarmak1_e) – "English (Tarmak1 - Colemak[eD] transitional)"
    us(tarmak2_et) – "English (Tarmak2 - Colemak[eD] transitional)"
    us(tarmak3_etr) – "English (Tarmak3 - Colemak[eD] transitional)"
    us(tarmak4_etro) – "English (Tarmak4 - Colemak[eD] transitional)"
• Also, there are some special Tarmak steps for learning Colemak with CurlAngle mods:
    us(tarmak1h_e) – "English (Tarmak1h - Colemak[eD] transitional w/ Curl-Hkm mod)"
    us(tarmak2dh_et) – "English (Tarmak2dh - Colemak[eD] transitional w/ Curl-DH mod)"
    us(tarmak2dhm_et) – "English (Tarmak2dhm - Colemak[eD] transitional w/ Curl-DH-matrix mod)"
• (For the DHm mod, the first Tarmak step can be learnt without any modification, but you may learn the Angle mod first and should learn it by step 2.)
• Tarmak step 3–4 can be combined with Curl by activating a Curl mod through the misc options or editing the symbols file containing your layout.


See my Locale Variants forum topic for the various locale solutions.

I took off a bit and made quite a bunch of these, heh! I can make more on request. It'd be nice with feedback from local users as some design decisions are open to debate and depend on actual usage as well as personal preferences.

Here's what I've covered so far, for the most part both with conservative 'keep local symbols' and my preferred 'unified symbols' variants
(On a side note, there were only 11 Dvorak layouts in the xkb files last time I looked!):
al at ba be bg br ca cz de dk es fi fr gb gr hr hu il is it latam nl no pl pt ro rs ru se si tr us

- The brackets (lvl3-4) and the LSGT key may hold the most common locale-specific keys.
     • The oe/aring special letters may well be replaced; these should also be on dead keys.
     • Furthermore, keys with non-essential mappings (H J K L) are up for grabs if need be.
     • See the colemak_template symbols file for more info on local Colemak[eD] variants.

    The Colemak [edition DreymaR] layout, Norwegian+Danish 'Unified Symbols' variant (mostly like the standard Colemak above).

    The Colemak [edition DreymaR] layout, Norwegian 'Keep Local Symbols' variant (symbols like local key markings).

Please note: The 'Local Symbols' variant for a locale uses symbol mappings from the default locale layout (usually a QWERTY one), which are also the ones normally found on physical key markings on keyboards made for that locale. The letter block, however, is the Colemak[eD] one which may lead to some inconsistencies or faults in lv3-4 mappings. For the most consistent and complete set of AltGr mappings, use the 'Unified Symbols' variants.

• You can select any layout from the normal layout chooser – enter your language in the search field to narrow it down. There are two types:
• "Unified symbols" (cmk_ed_us) layouts, using the US-like symbol mappings that I recommend; these give the full Colemak[eD] experience
• "Keep local symbols" (cmk_ed_ks) layouts, if you don't want to change the symbol mappings from your locale but just the letter keys (and semicolon)
• Using command line or default file, the Cmk[eD] layouts are called 'lo:cmk_ed_us' and 'lo:cmk_ed_ks', where 'lo' is the locale code ('se' for Swedish for instance)


See the phonetic subtopic of my Locale topic for more info on these layouts.

For the Greek and Hebrew phonetic variants I mostly moved the keys of their default phonetic xkb layouts to a Colemak setup, hardly changing anything else. Ideally, I should be able to define phonetic names for the keys corresponding to Colemak so that other 'phonetic' layouts would work automatically, but I think the XKB way of doing that may be too QWERTY-centric for that to work right now. For Kyrillic, I've used Ghen's excellent Rulemak which under my xkb patch is found under 'Russian (Colemak, phonetic E-Slavic)'. It isn't for Russians only, but that's how xkb likes to sort things. Similarly, for South Slavic there's the Bulgarian (Colemak, phonetic S-Slavic) variant now. Let me know how that works out, please?

    The Colemak phonetic layout for Greek, simply moving around the keys of the default (here xkb) Greek layout.

• You can select any layout from the normal layout chooser – enter your language in the search field to narrow it down.
• The non-latin script variants are called "<Language> (Colemak, phonetic)"
• Using command line or default file, the phonetic layouts are called 'ru:colemak', 'bg:colemak', 'gr:colemak' and 'il:colemak'


Advanced typing is possible with only one hand given a mimimum of training with the mirroring method. In fact, this paragraph was written entirely using the left hand with the exception of the mirroring key itself, with hardly any training! The brain is inherently good at mirroring things.

I think the Colemak is a very good layout for this kind of one-handed typing: It scores well on home-row usage, finger load balance and same-finger bigram avoidance, and it doesn't focus overmuch on hand alternation which could lead to same-finger bigrams when mirror-typing (Dvorak has lots of hand alternation; it also has separate right-hand and left-hand variants but then you'd have to learn a new layout).

You'll want an easily accessible key (such as a thumb key) to switch between normal and mirrored typing. One suggestion is using LAlt for left-handed typing, and RAlt or RWin for right-handed typing. But you may instead use a foot switch set to any other key (maybe an out-of-the-way one like ScrollLock), or a "ghetto foot switch" made by stripping most keys off a keyboard and placing it on the floor. A more fancy but still cheap foot switch could be made by soldering the wires from a foot pedal switch (if you have something useable) to the contacts of a key on a cheap keyboard.

Some adventurous souls might want to try the mirrored Colemak as a main layout? Some say it's more similar to Dvorak that way. However, my implementation is meant for one-handed typing. To use it as a standalone layout, you'll want to take out the remapping of special keys.

On XKB: Using a Group setup, add the mirrored Colemak[eD] as your next layout group.
     Then you may choose between a slew of "key(s) to change layout (while pressed)" options!
     This does compromise your group options a bit (if you need to use non-latin layouts etc).
     If that bothers you, consider using both 'next' and 'last' layout groups with chooser keys.
     Use Ubuntu: 'Keyboard Layout'->'Options'->'key(s) to change layout (while pressed)'.

    The Mirrored Colemak layout, which should be good for right-handed typing (the Angle mod is recommended for this)

    The Mirrored Colemak layout with the AngleWide-Slash mod (see the Wide mod heading); better for left-handed typing I think

• This is only for English(US) – if you want something else you'll have to edit it in yourself.
• You can choose it in the normal language chooser; it's called "English (Colemak[eD], mirrored)"
• Using command line or default file, the layout is called 'us:cmk_ed_mirror'
• AngleWide is chosen separately, as a keyboard model (see above)


This section tells you how to get and run my Linux/xkb mod files. The next section is about running setxkbmap to configure the layout choices. There are also specific HowTo instructions at the end of each mod section above.

• It's a good idea to have a standard-layout keyboard hooked up for this, for typing in commands before you're set up with your layout and model.
• For the files themselves you'll only need a computer with X.Org X11 (that is, almost any Linux distro); my files modify its xkb keyboard component.
• To use my scripts, you'll need BASH (BourneAgainSHell). Most distros have that now, but if you don't then the command sudo apt-get install bash will get it.
NOTE: Running setxkb(map) on a local directory doesn't seem to work now! If it cannot activate your layout, use a system install (-o) instead.
• (The '-d' and '-t' options are only used if your mod dir has an odd path/name. If you're using my files as they came, you won't need to set those.)
• (You probably won't need the '-g' option either, as the XF86 Cut/Copy/Paste keys aren't used in Extend anymore due to poor implementation; I map to Ctrl+X/C/V instead now.)

Point-by-point example: System install for Debian/Ubuntu and many other distros:

1. Download and unzip the dreymar_x-mod dir (see below) to, say, your home desktop (~/Desktop)
2. Open a terminal window and go there: cd ~/Desktop/dreymar_x-mod
3. To install/activate: sudo bash ./install-dreymar-xmod.sh -ox
4. See XKB Configuration step below and edit /etc/default/keyboard to make startup changes persistent
5. Reboot the system (to be on the safe side)
6. Select your layout such as English(Colemak[Ed], Curl-DH ergo) from dropdown top-right menu (Ubuntu) or settings → keyboard

Copying my xkb files:
Here's my GitHub BigBag XKB repository with original and changed files for what should be the latest XKB version (2.17.1ub1). They should actually be just fine for almost any version since the changes in the X versions I've seen have all been superficial and minor. The zip archive also contains the install script, some tools like the setxkb.sh script that activates a chosen layout using the setxkbmap command, and images of the locale layouts (in the doc folder).

Alternatively, use my Dropbox download. Just check that it's updated; I've been a little lax lately. My Dropbox support may be going out of style soon. :-)

Copying the changed files over the X11 ones (after backing up the old ones) should be simple and safe enough. This should give you the further option of installing to the X11 system directory so the changes show up in settings GUIs and such, or instead installing to an entirely different place of your choice and running the setxkbmap command pointing to that directory instead! However, we can't get the local setxkbmap to work at the moment so I guess we're stuck with system install for now. Note that you can't use the provided xkb files alone with setxkbmap as they aren't a complete xkb directory! You should use my install script to copy/install locally first. And make sure you have write privileges to the desired path.

I've made a script ('install-dreymar-xmod.sh') that takes care of business. Using various command line switches (call it with '-?' for instructions and defaults), it can backup, restore, install to a chosen directory or install to the system directory (with the '-o' switch). It can link to my setxkb.sh script to activate the new setup, and run a script to install GTK bindings for the Cut/Copy/Paste keys (but those didn't work anymore in the latest Ubuntu so I replaced them with actual Ctrl+X/C/V entries in the Extend mappings).

NOTE: You must use 'bash <script> -<options>' (or './<script> -<options>' with run privileges for the .sh file), not the 'sh' command! See above.
NOTE: You can get the xkb directory back to its original state by reinstalling the xkb-data package (e.g., 'sudo apt-get install xkb-data').

Install script usage example: System install
    • Force install to the system X11/xkb directory with '-o' (changes will show up in the system settings GUI)
    • (You may get asked for your sudo password, but you don't have to run the script with admin rights)
    • Just activate the default layout ('5w us us') with '-x'; necessary to get AngleWide as models aren't GUI selectable
    • (A backup of the xkb dir will automatically be made if no previous backup is found in the system X11 dir; to force a fresh one use '-b')

$> bash install-dreymar-xmod.sh -ox

Install script usage example: Restore
    • Restore the oldest backup with '-r 1'
    • (To get a newer one, use a higher number; may well be too high if you wish to ensure the latest backup)

$> ./install-dreymar-xmod.sh -r 1

Setup script usage example: Change model/layout with shortstrings, and write to file
    • For activating a single layout and model, we use a -s 'model locale eD-variant' shortstring
    • Activate model PC105-Curl(DH)AngleWide ergo mod (implemented as model+option).
    • Activate a French "UniSym" layout (at the moment, the default layout is my Norwegian Cmk[eD]...).
    • Append the resulting setxkbmap command to your ~/.bashrc file with '-a' so it gets activated on each logon.

$> ./setxkb.sh -as '5dw fr us'

(NB: If local-dir setxkbmap works for you!?) Install script usage example: Local default install
    • Install in the default location (safe, under your home directory, but inaccessible to the GUI)
    • Run setxkbmap too, activating the Croatian "Keep Local Symbols" Colemak[eD] layout
    • Also, activate the WideAngle ISO board model ('pc105awide-sl')
    • Since no system files are affected, force no backup with '-n'

$> bash install-dreymar-xmod.sh -ns '5w hr ks'

(NB: See above!) Install/setxkb script usage example: Local install to a specified path, then activate it manually, also adding a line to ~/.bashrc.
    • Run my install script with the '-i <path>' switch; here, I use '~/myxkb'
    • Run setxkbmap from the specified directory using 'setxkb.sh -d <path>'; also write the command to the ~/.bashrc file using '-a'
    • Activate a "vanilla" ANSI/US non-ergo-modded US Colemak[eD] (use two 'us': One for US(A) and one for "Universal Symbols" – the only US layout)

$> ./install-dreymar-xmod.sh -ni '~/myxkb'
$> ./setxkb.sh -s '4n us us' -ad  '~/myxkb/dxkb'

Linux GUI settings:
On Ubuntu using Gnome (and what else?): If you go to the Layout settings, hit '+' to add a layout and type in 'Colemak' you should see a bunch of additions. The Extend option is found under Options -> Miscellaneous Compatibility Options, and you should choose an appropriate lv5 switch for it (I've added a Caps Lock option). If you can't find it, your distro may not have those options visible in the Settings GUI and you may have to do it the command-line, dconf-editor and/or config file way.

The available Angle/Wide ergonomic mods are the Euro/ISO/PC-105 board ZXCVB> shift (named 'pc105angle-lg'), the Angle/Wide-Slash mod described above ('pc105awide-sl') as well as the US/ANSI/PC-104 board ZXCVB shift ('pc104angle-z') and Wide(Quote) mod ('pc104wide-qu'). Unfortunately, the current Ubuntu versions have lost the GUI Settings option to switch keyboard models (which I find very odd).

Using my setxkb script:
As seen above, I have a little script that activates layouts and options, allowing a shortstring notation to keep things compact. It's essentially just a wrapper for the setxkbmap command described below. To get more info on it, run it with -h for help or have a peek inside the script!

The shortstring format can be handy if you want to change layouts by hand. If not, just don't bother too much with it. A setxkb shortstring consists of:
Model, such as '4n' for an unmodded ANSI keyboard, '4a' for an Angle-Z modded ANSI board or '5aw' for a PC-105-AngleWide modded ISO board
Locale, such as 'us' for USA, 'no' for Norway etc
Variant, such as 'us' for my "Unified Symbols" solutions or 'ks' to "Keep Local Symbols"
• (There's no way to set XKB options with shortstrings, as that'd get too complex)

Using the setxkbmap command:
Start a terminal window and use the setxkbmap command to change your keyboard model, like this:

$> setxkbmap -model pc105awide-sl -v 9

(The '-v 9' is shorthand for '-query -verbose 9' which outputs useful info. You can run setxkbmap with only the '-v 9' switch if you wish.)
In my download archive there's a couple of shell scripts that do this for you.

If you have a non-PC104/PC105-compatible keyboard you might have to do it differently; let me know if you run into trouble.

The setxkbmap command can do more - particularly useful for, e.g., non-Gnome distros or if you like the command line:

$> setxkbmap -model pc105awide-sl -layout us,no -variant cmk_ed_us,cmk_ed_us \
  -option lv5:caps_switch_lock,misc:extend -v 9

The above example sets up an AngleWide-Slash keyboard with the standard Colemak[eD] layout for US and Norway (both using 'us' unified variants), Extend mode active and Caps as the Extend key. Thanks to Kruppe for this tip! :)

You may include the variants in parentheses, and if you only set the layouts you may omit the switch (see 'setxkbmap -help' for more info):

$> setxkbmap "us(cmk_ed_us),us(cmk_ed_mirror),fr(cmk_ed_ks),gr(colemak)" -v 9

(This time setting mirrored Colemak[eD] as the 2nd, French "keep local symbols" as the 3rd and Greek phonetic Colemak as the 4th layout)

Editing the /etc/default/keyboard file:
To make the change persistent between startups, sudo edit the /etc/default/keyboard file. Let's say we want to set up, say, an AngleWide mod, US English Colemak[eD] with group switch to Greek Colemak and an Extend layer with Caps switch (plus standard options like putting Compose on the Menu key and switching groups with both Shift keys):


Remember that this would need a reboot (or at least 'pkill X' or a trigger command to udevadm?) to kick in. Hope it works for you!


The XKB component is a quite powerful system for keyboard definitions, but it's very confusing and complex. I realize that many are unfamiliar with the terms of this trade and, basically, what the hell I've been talking about at all this length! :-)

So, let's explain a little. XKB, a.k.a. the X Keyboard Extension, is a part of the X Service which in Linux provides graphics and Input/Output capabilities for the Windows Manager to provide your user interface with. There are guides to XKB that explain this in more detail; whenever I'm confused I often start with ArchWiki which is a thorough and reliable resource.

Some terms you'll encounter around XKB:
• Model: What type of keyboard hardware you have.
    – There's many of these, but in fact most people in the West use the pc104 (ANSI) or pc105 (ISO) models.
    – I've piggybacked on the model definitions to create ergo mods in which keys are moved to better positions
    – Among these are the Angle mods for a better left-hand wrist angle, and the Wide mods for finger balance and hand separation

• Layout: What key layout you use. This includes QWERTY alternatives such as Dvorak or Colemak, but also locales such as US, UK, Sweden etc.
    – The list of locales I've made Colemak[eD] options for is long now! It's found above.

• Variant: Each locale may have several variant layouts, like the plain US vs US International ones. Or variants for ethnic groups in a locale.
    – I have two Colemak[eD] variants of each locale:
    – The "Unified Symbols" ("us") variants are my full locale layouts, providing symbols and dead keys aplenty optimized for the locale
    – The "Keep Local Symbols" ("ks") variants are for those who want the same symbols as shown on their key faces; these are more limited

• Options: This is other settings, like whether you want to remap your CapsLock key to a Backspace or something.
    – If you have a proper GUI keyboard setting panel, the options should show up with descriptions; otherwise, it can be a bit mystical
    – I use options like "misc:extend,lv5:caps_switch_lock" to activate my Extend mappings and make CapsLock an Extend shift
    – Another option I like is "grp:shifts_toggle" which lets you switch layout groups (see below) with both Shift keys
    – Also, "compose:menu" which makes the Menu key (lower right on full keyboards, sometimes missing on laptops) a Linux Compose key

• Group: You can have several layout/variant sets loaded, and switch between them with menus or shortkeys.
    – This lets me keep a phonetic Greek Colemak layout on group 2 so I can switch to it easily
    – Also, using mirorred Colemak is easy if you set the mirrored Colemak as your group 2 layout and a convenient group switch key

• Rules: This is the component that unites and presents the other files; it's used to generate menu choices in the GUI and options for setxkbmap for instance


• After the files have been modified, a restart may be needed although in my instdiff script I have included a 'trigger' command to udevadm which should take care of business
    [update: that feels unsafe so I'm not doing it by default anymore].
• You may also have to clean out the XKB server cache (/var/lib/xkb/server*.xkm) manually if you didn't use my script (requires admin privileges).
• If a layout isn't the first in the list in Linux, some programs may cause problems (Alt key not working as it should in Emacs for instance)! This is a known but annoying bug.
• Beware of file ownership issues (don't use 'gksu nautilus' but 'gksudo nautilus' for instance!) as they can break your OS GUI!

The xkb server can get its settings from several places so how your actual settings are determined may be a little confusing! It depends on whether you have Gnome, Unity, XFCE or something else but often the Gnome settings are present. This is what I think I know:
- If a compiled X server file is cached (/var/lib/xkb/server*.xkm), that usually takes presedence (until the udev settings are triggered?)
- The /etc/default/keyboard file should be read at startup to get default keyboard settings; I'm not sure when that happens though (due to the above?)
- The gnome settings ('gsettings list-recursively org.gnome.libgnomekbd.keyboard', or use 'dconf-editor') are important. They can also get messed up...
- (Did these settings use to reside in org.gnome.desktop.input-sources; do they still in some configurations?)
- The root windows has x properties ('xprop -root | grep XKB'). These reflect changes from the default file and setxkbmap.
- The setxkbmap command (see below) can override the above on a per-session basis; you can put it in a startup script if you wish.
- Sometimes on Debian I've experienced trouble with finding the server*.xkm file, and the Gnome settings conflicting with setxkbmap(?). Crashes have occurred.


• Made the Extend layer modifiers (A/S/T for Alt/Shift/Ctrl) work with the other keys like they do in my PKL implementation under Windows
• Extend Undo/Cut/Copy/Paste, navigation and F-keys work as they should, as does Wheel Scrolling
• Reviewed the Curl mod solution: Could keyboard models be better? [Verdict: This leads to very many models and an odd Extend layer...]
• Curl mods implemented as Options in addition to the US layouts (a bit strange, as they'd mess up non-Colemak layouts, but very useful)
• More locale variants: al hu ro tr, ba/hr/rs/si...
• Updated Rulemak and Bulmak to 2016 versions (ru/by/ua, bg/rs/mk – although only found in ru and bg so far):
    East Slavic (Russian/Church/Belarus/Ukraina?) & South Slavic (Bulgarian/ISO-9/Serbia(Cyrillic)/Macedonia?)
• Updates to the install and setxkb scripts. Clearer output, and setxkb now supports model-only shortstrings and curl "models" (see script -h)
• Tarmak layouts for Curl modders. The changes are minor, but should be easily accessible for the newcomer. [Already done for PKL/Win]
• Get this up and going on GitHub.
• Reassessed the Curl mod yet again with the new unified Curl mod. Models are now required, as CurlAngle mods which preserve Ext+V as Paste.
• Finished updating the Curl(DH) mods (I think)


• Present this better on GitHub! Preferably with nice presentation pages. (I know, I'm slow at this...)
• Something seems to break key repetition after a while in Ubuntu?!? Not sure it's my fault but...
• Dead keys need fixing (slash/stroke, currency, IPA, super/subscripts etc)
• Dead keys with currency on AltGr+4, Greek on AltGr+5, tech/math stuff on AltGr+= and IPA++ on AltGr+Shift+numbers(?)
• Make "phonetic" key aliases work for Colemak: Is there something wrong with the XKB (too QWERTY-centric?) or just my way of using it?
• A total of 4 Extend layers! Proposals: Basic/nav/edit, NumPad++, Coding/etc, Hotstrings
• Modifier keys for 4 Extend layers. For instance, Caps+{--, LAlt, RAlt, LAlt+RAlt}. Holding Caps or LAlt down should maintain the layer state.
• For some (or all?) Extend layers, a Lock (say, Shift+Alt+Caps locks; tapping Caps releases)
• A level7 modifier (i.e., both level5 and AltGr) in compat for use with the second Extend layer? (AltGr+Caps?)
• A solution for sticky Shift?! It's been suggested that it's a much better way of using modifiers than the traditional chording.
• More locale variants: epo (Esperanto), …? (Any suggestions, or comments on the existing ones?)
• Fix the Hebrew phonetic ("Hebmak") layout, once we agree on how! (With wrapman and whoever's interested.)


I've decided to call this kind of device a QUICKIE (QWERTY USB In, Colemak Key Input Emulated)! :-) A more proper name for it would be "USB-to-USB remapping device".

For more info, see the Big Bag of Tricks topic – USB2USB edition!

A very interesting XKB/Win/Mac-independent trick. A USB-to-USB device that plugs between the keyboard and whatever you're connecting your keyboard to, provides an OS independent solution that can accommodate many of my tricks! For people having to deal with zealous IT security rules, this may be the only solution short of getting an expensive remappable keyboard. It could let you type Colemak to, say, a PlayStation. And it could be fun to make one yourself if you're adventurous and DIY oriented!

It'll remap only key strokes so basic layout and ergo mods such as Colemak-CurlAngleWide(+Extend) are possible, but not AltGr or dead key mods such as Colemak[eD].

The safest and easiest option may be to order the brilliant USB to USB Converter from GeekHack user Hasu, who has also developed the TMK software for converting keyboards to more awesome keyboards. I provide TMK files in the USB-2-USB Big Bag topic.

    Hasu's USB to USB Converter for TMK Key mapping


As mentioned, this is mainly for touch screen devices (Android/Apple/etc) and as such I'll only mention it briefly here. In the Colemakoid MessagEase layout topic you can read more about this wonderful touch screen "keyboard" and my preferred settings for it. Highly recommended for your touch devices!

    My "Colemakoid" drag mappings for the MessagEase touch screen keyboard (shown with my "subtle" color scheme)

[5.3]    AMPHETYPE

Amphetype is a cross-platform, layout agnostic typing program written by user tristesse. I think it's very nice for typing texts, analyzing weaknesses and generating lessons. Check it out directly or from my Amphetype topic.

    Amphetype about to start a book text session (from Berens' Greek/Roman mythology)


This is a weird and wonderful thing: The rail shooter House Of The Dead converted into a typing game! Heh. So much fun.

The conversion is quite faithful, but with extra silly elements added – particularly in the first game. Zombies will often throw or wield kitchen utensils instead of knives and axes, and the main characters have a SEGA Dreamcast console with a huge cell battery strapped on their back as well as a SEGA keyboard before them.

The original is still lying about and considered abandonware, so if you're interested you may give it a spin of the barrel. The original's drills can be downright handy for practising a particular aspect of your typing. There are exercises focused on typing speed, accuracy, reaction and special keys. There's even a typing tutorial (QWERTY-based but still useful). I haven't had much trouble running it, but I had to disable my second screen. I ran it in 16-bit color but I don't think that's necessary.

    In The Typing Of The Dead, you'll meet various challenges such as the Tower boss. Type in the right answer to defeat it.

The second installment, Typing Of The Dead: Overkill is available on Steam, optionally bundled with several add-on dictionaries. It has more shine, but only three extra minigame modes. And I have a feeling that it's managed the nigh-impossible task of being even cheesier than the original. Beware! ;-)

    The Typing Of The Dead: Overkill has hi-res sound & graphics, and custom dictionaries such as this Shakespeare one!

For the record: I like both! The original is what I'll go to for typing training, though.

More info and downloads through these links:
The Typing Of The Dead (PC version)
The Typing Of The Dead: Overkill (Steam)


You don't need special hardware to use a special layout. On my laptop I blind type happily away using Colemak-CAW and the only change I've made is to scratch the N (QWERTY K) key a little to aid homing since I have a Wide ergo mod. But some will want the visual to match the experience. And naturally, many layout enthusiasts are also keyboard hardware enthusiasts!

These days, there are many many options to buy or make a keyboard to your liking. I have an old and somewhat dated physical board modding topic where you may pick up some ideas, but you may also want to search around for newer topics.

I also suggest checking out the Deskthority.net Wiki and the GeekHack.org forums as they are great founts of knowledge and opinions on most things keyboard. Especially mechanical switches, but lots of other things too.

    My Unicomp SpaceSaver Buckling Spring (IBM Model M ISO type) keyboard with "American Ninja" caps, splendidly sporting the Colemak-CAW layout.

Last edited by DreymaR (Yesterday 12:59:00)
  • 1
  • Reputation: 0
  • Registered: 06-Jul-2012
  • Posts: 4

amazing work !!

i just downloaded your version and i am gonna test it out
it might give me new ideas about the Greek Colemak Layout i am working on

  • 0
  • Reputation: 0
  • Registered: 24-Jul-2012
  • Posts: 2

I've managed to get the cut, copy and paste keys to work everywhere.
gtk-2 apps: put this code into ~/.gtkrc-2.0

binding "gtk-xf86cut-copy-paste"
        bind "XF86Cut"   { "cut-clipboard" () }
        bind "XF86Copy"  { "copy-clipboard" () }
        bind "XF86Paste" { "paste-clipboard" () }

class "*" binding "gtk-xf86cut-copy-paste"

gtk-3apps: put this code into ~/.config/gtk-3.0/gtk.css

@binding-set gtk-xf86cut-copy-paste
        bind "XF86Cut"   { "cut-clipboard" () };
        bind "XF86Copy"  { "copy-clipboard" () };
        bind "XF86Paste" { "paste-clipboard" () };

* {
        gtk-key-bindings: gtk-xf86cut-copy-paste
  • 0
  • Reputation: 41
  • From: Bærum, Norway
  • Registered: 13-Dec-2006
  • Posts: 3,978

@Kuglee: Interesting! I'm on Ubuntu 12.04 and I have only a ~/.config/gtk-2.0/ directory with one file in it (gtkfilechooser.ini). Do I make a fresh gtk.css file in there with that code and nothing else in it then?

  • 0
  • Reputation: 0
  • Registered: 24-Jul-2012
  • Posts: 2
DreymaR said:

@Kuglee: Interesting! I'm on Ubuntu 12.04 and I have only a ~/.config/gtk-2.0/ directory with one file in it (gtkfilechooser.ini). Do I make a fresh gtk.css file in there with that code and nothing else in it then?

Yes. I didn't have them either.

  • 0
  • Reputation: 0
  • From: Malmö, Sweden
  • Registered: 10-Sep-2012
  • Posts: 116

Hello DreymaR! Wow those are some awesome tricks you've got there! I especially like the extended layer that is activated when CapsLock is pressed.
I think it is really usefull since it is very frequent to jump between lines when writing code or essays. I am really tempted to use your layout, however I switch between ISO and ANSI very often when I work and therefor want one portable keyboard layout that I can universaly use.
I'm still a noob with portable keyboard layout. Can you please guide me on how to add the extended caps-lock layer and alt-gr mapping on normal colemak without having to use the angle/wide mod? Or even better, if it is relatively easy to achive, make one and add it to your post. I would be very greatfull to you if you did :).

Posted without the aid of a rodent.

  • 0
  • Reputation: 41
  • From: Bærum, Norway
  • Registered: 13-Dec-2006
  • Posts: 3,978

Thanks for the kind words! :)

Since you're using Windows, keep in mind there's a sister topic to this one where the PKL files and descriptions reside. I'll try to answer there, to "keep the family together". ;)

  • 0
  • Reputation: 0
  • Registered: 31-Oct-2012
  • Posts: 5

Me again =P.

Looking at the source code of xkeyboard-config* (package name on arch), I realized that some files, for example rules/base.lst are generated through its Makefile. Your diffs patch also patch the generated files so I was wondering if it was easier (or more straight-forward) to patch them from the upstream to get some kind of patched-version of xkeyboard-config.

*https://xorg.freedesktop.org/archive/in … .7.tar.bz2

Last edited by pablox (03-Nov-2012 02:12:19)
  • 0
  • Reputation: 41
  • From: Bærum, Norway
  • Registered: 13-Dec-2006
  • Posts: 3,978

It's true that the rules files come with the warning that you shouldn't edit them directly but I couldn't work out how else to do it. That's something I've wanted to learn. On ubuntu I couldn't find the Makefile (maybe I didn't look in the right places).

Thanks for the tip, I'll look into it!

Last edited by DreymaR (03-Nov-2012 08:07:33)
  • 0
  • Reputation: 1
  • Registered: 04-Feb-2010
  • Posts: 143

@ Dreymar: This has somewhat bothered me since you first started advertising your 'bag-o-tricks' thread, but how are you mirroring the keyboard? Mirroring is an awesome accessibility technique and you get serious bonus points in my book for including it, but while you mention that you typed a segment completely with the left hand with exception of the mirroring key, I see nothing to identify what key you are using to do it. Traditionally (and by traditionally I mean the Mattias 'I live on the blood sweat and tears of the disabled' Half-Qwerty Keyboard) mirroring has been done by holding the spacebar. Is that the idea here?

The extended mappings are a little confusing. You mention green, blue, orange and gray; and I'm looking at map that includes red, sand, purple, spruce... help! (Joking, but it could be clearer. Those circle buttons don't mean anything to me without looking at the code.)

Um... and while I have your attention, knowing you are into mechanicals, which mechanical switch do you prefer? The Bucking Springs require too much pressure for me, and I just got a keyboard with browns which I find... somewhat underwhelming. I'm wondering if it is an adjustment issue, or if maybe the blues or a Freestyle 2 might have been a better choice. Then again, even Sean Wrona seemed to be happy enough on one of those 'PerfectStroke' scissors Logitech has been producing (though they as clear about which models have it as they should be). If you have any input...?

Last edited by cevgar (10-Nov-2012 01:38:45)
  • 0
  • Reputation: 41
  • From: Bærum, Norway
  • Registered: 13-Dec-2006
  • Posts: 3,978

@Cevgar: Hiya, and thanks for the input! We love input. ;)

When I tested the mirroring, I used the RCtrl key as the mirror switch (i.e., I chose it as the Next Layout temporary switch key in Settings) and hit it with my other hand. I did that for both hands although if I were to use it much I'd of course choose the LCtrl or something like that for right-handed typing. This would be a decent way for people who can use the other hand but not its fingers well. For me it was only a test.

Any key can in theory be defined as the layout switch in the files, but it takes a little rules file fiddling (or recompiling, which I don't master yet).

I don't like spacebar mirroring, because since space is the most used character there's bound to be misfiring. I may be wrong, but that's my feeling about it. I've thought about using a foot switch (such as your brilliant "ghetto" solution!) but I'm uncertain as to whether it'd be fast enough? One rather promising and fascinating thought is those headbands that let you press a button (or two different buttons? not sure) by focusing your mind a certain way! If that's combinable with thinking about what you're typing it'd sure be a sweet and futurist approach.

OMG, you're actually more color-gay than I am! ;) Well, it probably could be clearer but this is what I've written up. I thought that between the graphic overview and the code snippet people would figure out what I mean. I guess a longer explanation would be productive but haven't found the "time" so far.

Concerning switches: I don't have strong preferences. I have a Buckling Spring board or two and like them (the old authentic IBM F feels better to me than the new Unicomp but I haven't used the latter a lot). In my daily routine however, I use laptop chicklet boards and I'm fine with that. Even the mushy membrane junk boards get the job done so I'm no snob. To me it's more about the mappings and posture.

  • 0
  • Reputation: 41
  • From: Bærum, Norway
  • Registered: 13-Dec-2006
  • Posts: 3,978

Inspired by Colemaker Lalop, I implemented a Wide mod for the ANSI/PC104/US generic keyboard model:


The "pc104Wide(Quote)" mod ('pc104wide-qu' is its keyboard model name in XKB) is a Wide ergonomic keyboard model that moves the four right-hand half-rows one key to the right. This helps hand separation notably on small keyboards, access to Enter/RAlt/Back and right hand pinky load.

Brackets are in the middle as with the pc105 Wide mod. The slash key simply moves into the middle which may be a little annoying to some but should be okay and is the most logical thing to do. The quote/apostrophe key had to move one row up but is still accessible with the same finger and a minimal change in effort. All in all it's a good mod I think.

I didn't implement any Angle mods for the lower left-hand half-row together with this Wide mod (for now). It's possible to edit the keycodes/evdev file yourself, commenting out the line in the pc104wide-qu section that augments pc104 and activating the line above that augments pc104angle-z instead. This won't change the displayed layout images like the one shown above (unless you also edit the corresponding part of geometry/pc) but it should affect the key presses after a restart. If not you may have to clear out the temp cache in /var/lib/xkb/ as described above.

[edit: Now that I think about it, this is in fact consistent with the A-Frame Angle mod! By shifting the left-hand number/top/home row as well, a proper wrist angle is acquired. Interesting!]

Last edited by DreymaR (19-Jan-2015 13:18:41)
  • 0
  • Reputation: 10
  • Registered: 06-Jun-2013
  • Posts: 441

hi dreymarr

i've just downloaded your zip and patched my xkb dir

I had a look at tarmak-1, i think it may contain a few errors

have a look at u, i, y and k (in qwerty terms)

a smart way of dealing with this could be to put your patch dir stuff on github or bitbucket - then i could just fork it and fix it then send you a pull request

i know how fiddly and error-prone this stuff is as i wrote tarmak-1 bindings myself before i found your link to your patches from this site

  • 0
  • Reputation: 41
  • From: Bærum, Norway
  • Registered: 13-Dec-2006
  • Posts: 3,978

Damn, you're right. I had forgotten to change some <AC##> codes to <AD##> ones (lines 235-256, 259-260 and 281 of symbols/colemak), affecting Tarmak 1–3. Wonder how that slipped by me. I'll fix it soon – but now you know what to change should you need it quickly. ;)

And you're right: I guess I should get this out to github. I'll figure out how, maybe this weekend.

[Edit: Okay, the ub1304 files are fixed properly and the ub1204 ones hack-fixed.]

Last edited by DreymaR (07-Jun-2013 21:42:19)
  • 0
  • Reputation: 10
  • Registered: 06-Jun-2013
  • Posts: 441

no worries - I'd already fixed it

github is *very* good for this sort of stuff - would mean no repetition of effort for bug fixes/enhancements and the like

i used it for the first time when i wrote the minimak xkb bindings and was bowled over by how user-friendly it was

prior to that i'd been using mercurial/bitbucket for other projects which are great but I'd say github was even easier to use

  • 0
  • Reputation: 0
  • Registered: 04-Apr-2013
  • Posts: 538

Okay, github completely changed the game with their new web interface.  Everything can basically be done online now.  Now, even a technologically inept person can make pull requests.*

Would definitely recommend.

*Note: requires changes to be pasted directly into online text fields.  If you want to sync to local repository, well, that's a bit harder.  Haven't tried fancier stuff like syncing from upstream either.

Edit: it looks like they've had this for a while and I've only just discovered it.  Maybe the new web interface just made it more noticable or something.

Last edited by lalop (08-Jul-2013 09:02:51)
  • 0
  • Reputation: 0
  • Registered: 04-Apr-2013
  • Posts: 538

Since I'd previously created the tarmak KLA exports, I've taken the liberty of submitting them to the new KLA site since you're away.  (It says "Submitted by DreymaR" because I filled in the "author" metadata that way, and I guess that's how author is rendered for now.)

I thought you might also be interested in submitting your wide/angle mods, etc.  He even has a European template with those extra keys!

(IIRC, 1-2 layer Extend can even be emulated by setting AltGr as Caps Lock.  However, the only mappings that currently make a difference seem to be those that print a character (and possibly backspace if he ever simulates an "error rate" in the analysis), so this might not make a big difference.)

Last edited by lalop (14-Jul-2013 08:31:09)
  • 0
  • Reputation: 0
  • From: Leafland
  • Registered: 17-Sep-2013
  • Posts: 32

your instructions are vague. I am having an incredibly hard time figuring out where to run this script from.

Last edited by Akiva (17-Sep-2013 14:08:15)
  • 0
  • Reputation: 10
  • Registered: 06-Jun-2013
  • Posts: 441

just tried your wide angle mods for the first time

they are awesome! almost no impact on my typing ability but it feels like the keyboard has 'opened up' underneath my fingers

definitely going to stick with it - i think my right pinkie will thank me for it

i just swapped the j and k keycaps so i have the 'ridge' under my right index finger still  - left everything else the same

thanks again for providing this

  • 0
  • Reputation: 10
  • Registered: 06-Jun-2013
  • Posts: 441

haha just fired up emacs - can i withdraw that last post, its actually really difficult

but i still like it!

  • 0
  • Reputation: 41
  • From: Bærum, Norway
  • Registered: 13-Dec-2006
  • Posts: 3,978

Hope it works for you, bph! :)

Akiva – any tips on improving the instructions? The script is run from wherever it's unpacked at long as that's in the same folder as the folder with the patch files. If you have a distro that keeps its X11 files anywhere else than /usr/share/X11 you'll have to edit the instdiff script a bit to reflect that.

  • 0
  • Reputation: 10
  • Registered: 06-Jun-2013
  • Posts: 441

i wonder if the switch from X to mir in ubuntu 13.10 will beggar up all the keyboard stuff?

  • 0
  • Reputation: 41
  • From: Bærum, Norway
  • Registered: 13-Dec-2006
  • Posts: 3,978

I've thought about Mir. My impression is that they'll keep the old layout definition syntax for Mir, since there's a huge amount of files written for all sorts of locales. Maybe they'll try to clean up some of it, but as long as they stick to the same syntax I'll be fine I guess. The way I gather it, the XKB component isn't the most controversial part of X.

Maybe the 'rules' (or whatever it'll be called) will follow a different format; if so, we'll just have to figure it out.

  • 0
  • Reputation: 10
  • Registered: 06-Jun-2013
  • Posts: 441

tempted to swap \# for =- on the bottom row to make it more programmer friendly...

(and after another day of use I revert to my initial position that the wide/angle mods aren't too difficult to pick up)

Last edited by bph (23-Sep-2013 13:47:24)
  • 0
  • Reputation: 41
  • From: Bærum, Norway
  • Registered: 13-Dec-2006
  • Posts: 3,978

Both '\' and '-' are frequently necessary for coding so I'm not sure what that'd accomplish. It's a bit of a dilemma; if I coded enough I'd consider putting some of the symbols and brackets on easily reachable AltGr positions like others have done before. As it stands, I'm happy with the AltGr mappings I use now.

Last edited by DreymaR (24-Sep-2013 14:38:11)
  • 0