• You are not logged in.

Mod-DH for Colemak

  • Started by stevep99
  • 261 Replies:
  • Reputation: 0
  • Registered: 12-Dec-2018
  • Posts: 5

Why isn't this mod available in the usual way? With either setxkbmap or via any of the DE GUIs? It's really way better. Is it http://www.kbd-project.org that should be asked? Or could someone clarify how it is installed?

Last edited by oyo (12-Dec-2018 14:41:16)
Offline
  • 0
  • Reputation: 214
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,363

Have you found the Big Bag for XKB yet? That's where I try to clarify everything. That, and the Github repo.

I've considered asking the xkb people to add my Big Bag to xkb-data, but haven't yet gotten to the point where I can make a proper pull request.

*** Learn Colemak in 2–5 steps with Tarmak! ***
*** Check out my Big Bag of Keyboard Tricks for Win/Linux/TMK... ***

Offline
  • 0
  • Reputation: 23
  • From: Belgium
  • Registered: 26-Feb-2008
  • Posts: 482

Did you implement Colemak-DH as a layout variant, or as a geometry like the Wide mod?

Offline
  • 0
  • Reputation: 214
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,363

The Wide and Angle mods are geometries so they will affect Extend. Colemak-DH started as a purely "soft" mod but unfortunately now it's a bit of both since I want Ctrl+V to still be Paste both in the layout and Extend positions. So there's a special set of Extend Angle geometries to account for that. Modularity couldn't be maintained completely.

But at heart, the DH mod is still an option for Colemak. So it only changes the necessary keys around, in any layout. Best not use it with a non-Colemak layout then, hehe!

Last edited by DreymaR (12-Dec-2018 16:28:07)

*** Learn Colemak in 2–5 steps with Tarmak! ***
*** Check out my Big Bag of Keyboard Tricks for Win/Linux/TMK... ***

Offline
  • 0
  • Reputation: 0
  • Registered: 12-Dec-2018
  • Posts: 5

I'm using the xmodmap [not sure exactly from where] but i think it has all mods. I'm reluctant to sudo on /etc/ so I won't use the bigbag plus iirc it has other things I don't need/want. Can the same config be done in ~/.local/ ?

currently I have this bound to a key but it seems xmodmap is slower to execute than setxkbmap

#!/usr/bin/dash
read lang < /tmp/lang
    if [ "$lang" -eq "0" ]; then
        setxkbmap -layout bg -variant bds
        echo 1 > /tmp/lang
    else
        xmodmap ~/.xmodmap
        echo 0 > /tmp/lang
    fi
Offline
  • 0
  • Reputation: 0
  • Registered: 12-Dec-2018
  • Posts: 5

edited the us layout file

only prob is the caps lock backspace doesn't repeat

diff

halp

Last edited by oyo (30-May-2019 17:33:30)
Offline
  • 0
  • Reputation: 117
  • From: UK
  • Registered: 14-Apr-2014
  • Posts: 978

Looks like you've changed the default US colemak definition there. I'm not sure about the repeating backspace, but I think it would be a lot easier to just use DreymaR's XKB files, they have been tried and tested.

Using Colemak-DH with Seniply.

Offline
  • 0
  • Reputation: 214
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,363

But oyo stated above that they don't want to sudo on /etc, with which I do sympathize. I've tried using the local directory option of setxkbmap without success earlier. But I recently heard of a trick someone used to make it work with a local dir: Pipe the print output from setxkbmap to xkbcomp. I'll look into that when I can.

I've had some trouble with key repeat in some distros when using Extend though. Fair warning.

Last edited by DreymaR (31-May-2019 13:36:35)

*** Learn Colemak in 2–5 steps with Tarmak! ***
*** Check out my Big Bag of Keyboard Tricks for Win/Linux/TMK... ***

Offline
  • 0
  • Reputation: 117
  • From: UK
  • Registered: 14-Apr-2014
  • Posts: 978

Oh, fair point, I thought your XKB stuff did already have a local directory mode, but I must have been mistaken.

Using Colemak-DH with Seniply.

Offline
  • 0
  • Reputation: 214
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,363

It does, but as I remember it people had trouble actually running the layout from the local dir. It's been a while since I checked this though...

*** Learn Colemak in 2–5 steps with Tarmak! ***
*** Check out my Big Bag of Keyboard Tricks for Win/Linux/TMK... ***

Offline
  • 0
  • Reputation: 0
  • Registered: 12-Dec-2018
  • Posts: 5

i don't know if ~/.local/share/X11/xkb/symbols/ works, doesn't seem to be read

oyo said:

edited the us layout file
only prob is the caps lock backspace doesn't repeat

an update must have overwritten the us file, i patched it again, it repeats now (edit: bah doesn't work again)

stevep99 said:

Looks like you've changed the default US colemak definition there.

yes, that allows me use it in gnome; i used the xmodmap as a reference

Last edited by oyo (03-Jun-2019 09:02:23)
Offline
  • 0
  • Reputation: 0
  • Registered: 02-Jun-2019
  • Posts: 1

Hi, Xkb can read files from the home directory, but it needs to recompile/reread keyboard descriptions (via xkbcomp with -I option). I've tried and backspace does repeat (altough I prefer having caps as ctrl). I use a simple script that is run in ~/.xinitrc to ensure it reads my custom layout.

I've created a ~/.config/xkb directory that contains symbols/ and keymap/ directories. Run setxkbmap -layout "us(colemak)" && setxkbmap -print and save the output in ~/.config/xkb/keymap/custom.xkb. Then create a file in symbols/. Let's call it custom. Let everything be as it is, just remap the keys you want. In my case:

Spoiler:
# ~/.config/xkb/symbols/custom
default partial
xkb_symbols "colemak" {
		include "us(colemak)"

			# Qwerty B to \
    key <AB05> { [            backslash,            bar,      dead_breve,       asciitilde ] };

		# TOP
    key <AD05> { [            b,            B,      dead_breve,       asciitilde ] };

		# HOM
    key <AC05> { [            g,            G,      dead_ogonek,       asciitilde ] };
    key <AC06> { [            k,            K,  dead_abovering,       asciitilde ] };

		# BOT
    key <LSGT> { [            z,            Z,       zabovedot,        Zabovedot ] };
    key <AB01> { [            x,            X, 	        zacute,           Zacute ] };
    key <AB02> { [            c,            C,          cacute,           Cacute ] };
    key <AB03> { [            d,            D,  dead_diaeresis,       asciitilde ] };
    key <AB04> { [            v,            V,      dead_hacek,       dead_caron ] };
    key <AB06> { [            m,            M,     dead_macron,       asciitilde ] };
    key <AB07> { [            h,            H,      dead_caron,       asciitilde ] };

    include "level3(ralt_switch)"

};

You can create a full layout, but I'm lazy so just included us(colemak) and rebound what I wanted. Let't go back and edit ~/.config/xkb/keymap/custom.xkb:

Spoiler:
#~/.config/xkb/keymap/custom.xkb
xkb_keymap {
	xkb_keycodes  { include "evdev+aliases(qwerty)" };
	xkb_types     { include "complete"      };
	xkb_compat    { include "complete"      };
	#xkb_symbols   { include "pc+us(colemak)+inet(evdev)" }; # Generated via setxkbmap
	
	# Custom colemak
	xkb_symbols   { include "pc+custom(colemak)+inet(evdev)" };
	
	xkb_geometry  { include "pc(pc105)"     };
};

I have a pc105 (uk style) keyboard, so your output from setxkbmap might be different. Also, why custom(colemak)? colemak is the value of xkb_symbols in our file, custom is the name of the file.

My script that I run via "$HOME/.bin/xkb.sh" in my ~/.xinitrc:

Spoiler:
#~/.bin/xkb.sh
#!/bin/sh
XKBDIR="$HOME/.config/xkb"
xkbcomp -synch -w3 -I$XKBDIR $XKBDIR/keymap/custom.xkb $DISPLAY &>/dev/null

(Remember to chmod +x the script). Tested only on Void Linux, but it shouldn't depend on a distro (as long as you run Xorg and not Wayland, of course). I think it should work with any directory, just change the value of $XKBDIR in this script as appropriate. The script can be run in the terminal to change the layout immediately (no need to restart Xorg, lol). Btw. setxkbmap doesn't have to be invoked. The layout should be loaded on its own.

EDIT: Changed the layout a bit, but I highly suggest using your own setup. I'm gonna make some other changes to it, but my goal is to fill my needs, e.g. I'm gonna use backslash as an extra super key.

Last edited by kstef (03-Jun-2019 14:34:33)
Offline
  • 0