Skip to content

Instantly share code, notes, and snippets.

@Tarrasch
Last active July 27, 2021 22:25
Show Gist options
  • Save Tarrasch/1293692 to your computer and use it in GitHub Desktop.
Save Tarrasch/1293692 to your computer and use it in GitHub Desktop.
Swedish colemak (Svensk colemak)

Installation instructions for Ubuntu

sudo cp /usr/share/X11/xkb/symbols/us{,-backup}
sudo vim /usr/share/X11/xkb/symbols/us % or whatever editor you use

Now, simply REPLACE the english colemak with the code. For the changet to take affect, just log in and out. If you want to avoid the replace, you can do it the proper way by following these instructions.

BUT DON'T!! I've done that and it's just a waste of time. If you really don't want to replace en colemak, replace something else!

About this layout:

AltGr+a --> ä
AltGr+l --> å
AltGr+ö --> ö

where a, k, ö are the physical positions for qwerty.

Note it's just a movedown of the colemak keys except for å since it's a vowel and should not be placed at the same key as the non-vowel r! (Think of words like råtta and år)

Also I've put arrow keys on home row and put esc there as well for vim users. Furthermore I've put home/end and pgup/pgdn on the buttons where the long fingers can reach comfortably while your thumb is holding down AltGr. I srongly recommend these tricks to everyone, even those not wanting a Swedish layout or are using QWERTY.

Feedback

I would love to discuss this, feel free to comment on this gist!

// Colemak symbols for xkb on X.Org Server 7.x
// 2006-01-01 Shai Coleman, http://colemak.com/ . Public domain.
// Swedish version by Arash Rouhani
partial alphanumeric_keys
xkb_symbols "colemak" {
include "us"
name[Group1]= "English (Colemak)";
// Alphanumeric section
key <TLDE> { [ grave, asciitilde, dead_tilde, asciitilde ] };
key <AE01> { [ 1, exclam, exclamdown, onesuperior ] };
key <AE02> { [ 2, at, masculine, twosuperior ] };
key <AE03> { [ 3, numbersign, ordfeminine, threesuperior ] };
key <AE04> { [ 4, dollar, cent, sterling ] };
key <AE05> { [ 5, percent, EuroSign, yen ] };
key <AE06> { [ 6, asciicircum, hstroke, Hstroke ] };
key <AE07> { [ 7, ampersand, eth, ETH ] };
key <AE08> { [ 8, asterisk, thorn, THORN ] };
key <AE09> { [ 9, parenleft, leftsinglequotemark, leftdoublequotemark ] };
key <AE10> { [ 0, parenright, rightsinglequotemark, rightdoublequotemark ] };
key <AE11> { [ minus, underscore, endash, emdash ] };
key <AE12> { [ equal, plus, multiply, division ] };
key <AD01> { [ q, Q, adiaeresis, Adiaeresis ] };
key <AD02> { [ w, W, Home, Home ] };
key <AD03> { [ f, F, End, End ] };
key <AD04> { [ p, P, End, End ] };
key <AD05> { [ g, G, dead_ogonek, asciitilde ] };
key <AD06> { [ j, J, dstroke, Dstroke ] };
key <AD07> { [ l, L, Next, Next ] };
key <AD08> { [ u, U, Next, Next ] };
key <AD09> { [ y, Y, Prior, Prior ] };
key <AD10> { [ semicolon, colon, odiaeresis, Odiaeresis ] };
key <AD11> { [ bracketleft, braceleft, guillemotleft, 0x1002039 ] };
key <AD12> { [ bracketright, braceright, guillemotright, 0x100203a ] };
key <BKSL> { [ backslash, bar, asciitilde, asciitilde ] };
key <AC01> { [ a, A, adiaeresis, Adiaeresis] };
key <AC02> { [ r, R, Escape, Return ] };
key <AC03> { [ s, S, Left, Left] };
key <AC04> { [ t, T, Right, Right] };
key <AC05> { [ d, D, dead_diaeresis, asciitilde ] };
key <AC06> { [ h, H, dead_caron, asciitilde ] };
key <AC07> { [ n, N, Down, Down] };
key <AC08> { [ e, E, Up, Up] };
key <AC09> { [ i, I, aring, Aring ] };
key <AC10> { [ o, O, odiaeresis, Odiaeresis ] };
key <AC11> { [ apostrophe, quotedbl, otilde, Otilde ] };
key <AB01> { [ z, Z, XF86AudioStop, AE ] };
key <AB02> { [ x, X, XF86AudioPlay, asciitilde ] };
key <AB03> { [ c, C, XF86AudioPrev, Ccedilla ] };
key <AB04> { [ v, V, XF86AudioNext, OE ] };
key <AB05> { [ b, B, dead_breve, asciitilde ] };
key <AB06> { [ k, K, dead_abovering, asciitilde ] };
key <AB07> { [ m, M, XF86AudioLowerVolume, asciitilde ] };
key <AB08> { [ comma, less, XF86AudioRaiseVolume, asciitilde ] };
key <AB09> { [ period, greater, XF86AudioMute, asciitilde ] };
key <AB10> { [ slash, question, questiondown, asciitilde ] };
key <CAPS> { [ BackSpace, BackSpace, BackSpace, BackSpace ] };
key <LSGT> { [ minus, underscore, endash, emdash ] };
key <SPCE> { [ space, space, space, nobreakspace ] };
include "level3(ralt_switch)"
};
@oleander
Copy link

👍

@wagasuki
Copy link

Thanks for putting this together! It has been a great help.
IMHO there are two things that could be tweaked. First is that a somewhat common key is missing from this layout and that is the "é" key (alt+k, qwerty; alt+e, colemak) which has been replaced by uparrow. Maybe the uparrow could be placed on alt+i (qwerty) instead?
Second is the alt+s (alt+r colemak) which is "esc" in this layout. It is common that an "r" follows an åäö and very often you make the mistake of not letting the alt_gr key up completely before hitting the r. If you for example are in an email application such as outlook this will bring up a dialog box asking if you want to delete the mail. The problem is that if this "r" is in the end of the word, which it often is, you often hit the space key directly after, this will delete the email. I don't know how many times I've lost long emails this way. Accidental escape presses will loose you information in many different applications.
I have planned on looking into tweaking this myself, thought I'd just share this in case it could be useful.
Again, thanks for this layout, I use it every day!!!

@wagasuki
Copy link

Ok, so I have done some tweaks in my layout as described in my previous comment. So I moved the uparrow to the u key (colemak), this way I will use the same finger for uparrow as before (middle finger) but in a for me more logic position that is easier to remember (resembling the "normal" up/down arrow keys). I put in the é on alt+e (for words such as: idé, café etc.). I removed the esc/return from alt+r and moved it to alt+w (I will then use the same finger as before). I then replaced the End that was on alt+f with Home. The End key was mapped to both alt+f/p. This way I have the Home/End on f/p and with the left/rightarrow below on s/t it is logical and easy to remember.

@Tarrasch
Copy link
Author

Hi @wagasuki, I'm so sorry for not finding your comments until now! Some things:

  • You perhaps have a physically longer index finger than me, for me the stretch to the "r_qwerty" and "u_qwerty" physical keys are a bit difficult.
  • I also have found the Escape key on altgr+r to be a total pain and have made me close so many dialogs by mistake. I just took a stab at moving it. Not sure where I want it to be though.
  • For the last 6-7 years I've lived with the total pain of the arrow and home keys not working in apps like chromium, alacritty, intellij, eclipse etc. Today I took a stab at fixing it and it kinda works!

To see all these recent (today's) changes. Please see the commit history of this gist-repo.

Finally, I'm so happy to hear you've used this keyboard layout and that you've had an overall good experience. It makes my day. :)

Cheers,
Arash

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