• You are not logged in.

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

  • Started by DreymaR
  • 384 Replies:
  • Reputation: 11
  • Registered: 06-Jun-2013
  • Posts: 551

cheers for speedy response - the more people using it the more issues get spotted/fixed/improved so all good I think

Offline
  • 0
  • Reputation: 11
  • Registered: 06-Jun-2013
  • Posts: 551

back up and running now - you had me sweating for a time there

one thing that can trip you up - running full disk encryption under ubuntu, from what I can see so far (first time used today) entering the password for that seems to be in vanilla qwerty no matter what else you have set up - whereas logon pwd seems to be whatever you have setup - nasty!

and as everyone here will know only too well, its passwords that get you when you start messing around with keyboard layouts

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

Glad it's working now! :-)

I must admit I've grown fond of passwords with numbers, symbols and the letters AQWZCX etc. I know, for saying this I'll get my accounts hacked horribly...

*** 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: 480

I have disk encryption on Arch linux and my initramfs where I enter the passphrase has Colemak support (keymap hook).

If you don't have such option, for passwords that are entered in Qwerty environments only, you can change your password to the equivalent of typing it in Colemak.  It will be more gibberish hence more secure that way. ;-)

Offline
  • 0
  • Reputation: 11
  • Registered: 06-Jun-2013
  • Posts: 551

I came to the same conclusion about using keys/numbers/symbols that are the same on both qwerty and colemak

you have to be careful with zxcv on an ISO keyboard if you're using the wide mod as they are different to vanilla qwerty, i.e. your 'z' will be a '\'

likewise for numbers > 6

thanks ghen for the tip on initramfs, I'll have to look into that..

and thanks again dreymar for your 'big-bag' - I realise now that my ability to interact with a computer is almost completely dependent on it, please don't stop doing what you do or I am royally screwed

Last edited by bph (19-Jan-2016 12:32:00)
Offline
  • 0
  • Reputation: 210
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,343

Thanks for the support! Yeah, I know, we've dug ourselves into a massive trench of keyboard awesomeness haven't we. ;-)

Last edited by DreymaR (20-Jan-2016 10:56:33)

*** 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: 30-Jan-2016
  • Posts: 5

I'm trying to get the xkb files from the startpost working when installed to a local directory, but I seem unable to get it to work despite using exactly the commands given in the start post.

[hge@quasar:dreymar_xkb] $ ./install-dreymar-xmod.sh -ni '/home/hge/myxkb'

@@@ DreymaR's Big Bag Of Tricks install script (by GadOE, 2015-01) @@@

¤ Found mod root dir './x-mod_v2-12-1_2015-01-18'
¤ Subdirectories to mod: 'xkb'
¤ Backing up: None
¤ Installing mod files in '/home/hge/myxkb/dmod-xkb'


@@@ XKBmap activation skipped @@@


@@@ install-dreymar-xmod.sh finished! @@@

[hge@quasar:dreymar_xkb] $ ./setxkb.sh -s '5n us us' -d '/home/hge/myxkb'

@@@ DreymaR's setxkbmap script (by GadOE, 2015-01) @@@

¤ Using model/layout 'pc105'/'us(cmk_ed_us)' from ShortStr
¤ Changed dir to '/home/hge/myxkb'
¤ Looking for and removing any old .xkm server files
Password: 
¤ Running setxkbmap:

Setting verbose level to 9
locale is C
Warning! Multiple definitions of keyboard model
         Using command line, ignoring X server
Warning! Multiple definitions of keyboard layout
         Using command line, ignoring X server
Trying to load rules file ./rules/evdev...
Trying to load rules file /etc/X11/xkb/rules/evdev...
Success.
Applied rules from evdev:
rules:      evdev
model:      pc105
layout:     us(cmk_ed_us)
options:    misc:extend,lv5:caps_switch_lock,grp:shifts_toggle,compose:menu
Trying to build keymap using the following components:
keycodes:   evdev+aliases(qwerty)
types:      complete
compat:     complete
symbols:    pc+us(cmk_ed_us)+inet(evdev)+group(shifts_toggle)+compose(menu)
geometry:   pc(pc105)
Error loading new keyboard description

¤ Changed dir to '/home/hge/tools/dreymar_xkb'

@@@ setxkb.sh finished! @@@

The warning sign is the error message, but it doesn't give me enough info to debug. Does anyone have a pointer on what I'm
doing wrong?

Output of the show-xkb.sh script below as that might help:

[hge@quasar:dreymar-xtools] $ ./show-xkb.sh 

••• DreymaR's Show XKB info script (by GadOE, 2014) •••


••• Output from 'xprop -root | grep "XKB"': •••

_XKB_RULES_NAMES(STRING) = "evdev", "pc105angle-lg", "gb,gb", ",colemak", ""

••• Output from 'gsettings list-recursively org.gnome.libgnomekbd.keyboard': •••

No such schema 'org.gnome.libgnomekbd.keyboard'

••• Output from 'setxkbmap -print': •••

xkb_keymap {
    xkb_keycodes  { include "evdev+aliases(qwerty)"    };
    xkb_types     { include "complete"    };
    xkb_compat    { include "complete"    };
    xkb_symbols   { include "pc+gb+gb(colemak):2+inet(evdev)"    };
    xkb_geometry  { include "pc(pc104)"    };
};

••• Press any key to finish: •••

btw) This is on Slackware Current, with a Microsoft Natural 4000 keyboard.

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

Hi, Moesasji! Sorry, there's been a documentation hiccup. My script will only install and mod the xkb folder as of today, but it's ready to mod for instance the locale folder as well so it'll make subfolders in your specified directory. In this case, you can see from your output that my script was in fact...

¤ Installing mod files in '/home/hge/myxkb/dmod-xkb'

So, I've fixed the documentation to reflect this, like this:

$> ./install-dreymar-xmod.sh -ni '~/myxkb'
$> ./setxkb.sh -s '4n us us' -d  '~/myxkb/dmod-xkb'

In your case, it looks like the install itself went well so you just need to run the second command to activate your layout (in your case, '5n us us' means ISO keyboard without ergo mods, standard US layout).

The setxkbmap command needs to find the xkb directory. Those warnings about multiple layouts don't matter, that's typical of setxkbmap usage.

Last edited by DreymaR (30-Jan-2016 21:47:42)

*** 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: 30-Jan-2016
  • Posts: 5

Unfortunately that makes no differences. The keymap doesn't get loaded if I run the updated command either. Additional info:

My Xorg.0.log shows the following warning when I run setxkb.sh

[1154467.442] (EE) Error loading keymap /var/lib/xkb/server-0.xkm

That directory is empty except for a readme file and as far as I can see the problem must originate the setxkbmap call in the script. All options it gets called with look correct.

edit)
It might be relevant. The above was using the version as downloaded from github; now I look closer the one on github appears outdated compared to the zip-file linked in the first topic as the x-mod directories have a different date. However installing the zip-file from this topic start fails for me on:

[hge@quasar:dreymar_x-mod] $ ./install-dreymar-xmod.sh -ni '/home/hge/myxkb'

@@@ DreymaR's Big Bag Of Tricks install script (by GadOE, 2015-01) @@@

¤ Found mod root dir './x-mod_v2-12-1_2015-11-22'
¤ Subdirectories to mod: 'console xkb'
¤ Backing up: None
WARNING: Root or sudo access may be needed!
¤ Installing mod files in '/home/hge/myxkb/dmod-console'

@@@ install-dreymar-xmod.sh - ERROR: Local files copy error! @@@

If I look at the script it tries to copy the content of /usr/share/X11/console. This fails because there is no console directory in any of my X11 folders. Removing the console from the install directory makes the install complete, but still no luck in actually having it work. The Xorg.0.log shows when I run setxkb.sh:

[1160807.896] (EE) Error compiling keymap (server-0)
[1160807.896] (EE) XKB: Couldn't compile keymap
Last edited by moesasji (30-Jan-2016 23:57:59)
Offline
  • 0
  • Reputation: 210
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,343

Hi! I'm sorry I didn't get a look at this during the weekend. I promise to take a peek as soon as I can (which won't be today I'm afraid).

Meanwhile, if you have root/sudo rights you could install to the system folders. The install script will backup the system xkb directory for you so it should be quite safe!

[edit: I can confirm that there's a problem activating my layouts and models with a local install (on Debian 8) even though the rules are read correctly. Other, non-DreymaR, models and layouts seem to compile fine from the new folder. I'm looking into it. Grrr...]

[edit: It seems there's something fishy with setxkbmap: It reads the local rules file just fine, but then it must be looking in the X11 folder for the rest or some such stupidity! So it can for instance see the name of a keyboard model I've defined, but it doesn't find the actual definition of it. Ugh.]

Last edited by DreymaR (03-Feb-2016 22:55:14)

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

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

Yup, my conclusion has to be that the setxkbmap command is wonky regarding local folders. I'm pretty sure that worked for me earlier, but...

An install with the -xo parameters (backup and replace the system X11/xkb folder) worked for me just now. Guess you have to use that, then.

Last edited by DreymaR (03-Feb-2016 22:57:25)

*** 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: 30-Jan-2016
  • Posts: 5
DreymaR said:

An install with the -xo parameters (backup and replace the system X11/xkb folder) worked for me just now. Guess you have to use that, then.

OK, I will go for that approach instead then. Anyway, thanks for looking into this!

btw) you did spot my comment on the install-script failing if there is no console directory?

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

Yes, and I've fixed it in my download files just now (not on GitHub, unfortunately). Thanks for the tip!

In these files, the .sh scripts should have run rights.

Last edited by DreymaR (04-Feb-2016 09:12:40)

*** 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: 03-Mar-2016
  • Posts: 2

Hello, I've been using Tarmak1 from your download installed to linux for about a week now. Been great, thank you! Two small issues:

Left alt key works, right alt key doesn't. I switched back to qwerty to see the right alt key normally works. Think probably a bug on "your end"?

At boot, login screen and default keyboard are qwerty - mildly confusing, probably a PEBCAK on "my end". Alt-capslock switches me back thenceforth, I even get to use Tarmak on lock screen! But cannot use tarmak on first login.

(Using linux mint 17, cinnamon DE)

(I installed with -o, I don't remember what -x was but it seemed undesirable or unnecessary at the time)

Last edited by tarmakology (03-Mar-2016 14:51:01)
Offline
  • 0
  • Reputation: 210
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,343

Right Alt works – as Colemak[eD] should! That is, it's an AltGr key for producing fancy glyphs. This is as intended.

In your US layout there is no AltGr so the RAlt works just as another Alt. If you want that back, there are some Alt key options you could select I think but if not you'll have to uncomment a "lvl3" switch line in the layout itself (or its includes).

*** 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: 03-Mar-2016
  • Posts: 2
DreymaR said:

Right Alt works – as Colemak[eD] should! That is, it's an AltGr key for producing fancy glyphs. This is as intended.

In your US layout there is no AltGr so the RAlt works just as another Alt. If you want that back, there are some Alt key options you could select I think but if not you'll have to uncomment a "lvl3" switch line in the layout itself (or its includes).

Ah, that makes sense.

Part of my reason for switching is because left hand very injured from typing - always use right hand chord keys, never left unless I have to. Might try moving A away from standard spot to save the poor pinky.

‚‘’®æßðþʒ†©÷πº—‹€–ç× don't seem like keys I'll need any time this year, I will make the switch, thanks for helping me understand what was happening!

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

It depends on which layout you use, but it can also be overridden by a counter command later on (so you could get your desired behavior using, e.g., setxkbmap, no matter what the layout had set before).

xkb_symbols "cmk_ed" {
    include "colemak(cmk_ed_letters)"
    include "colemak(cmk_ed_symbols)"
    include "level3(ralt_switch)"
    name[Group1]= "English/Intl (Colemak, edition DreymaR)";
};

Example from symbols/colemak; the interesting line is level3(ralt_switch), where you'd like something else than ralt_switch. I think maybe you want '  lv3(ralt_alt)', but not quite sure. What the normal US layout does is simply to not have any level3() lines, so if you comment out the one(s) that cause your unwanted behavior that'll work. But if you're unlucky, the ralt_switch may be included several places in your definition chain.

*** 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: 30-Jan-2016
  • Posts: 5

I'm playing around with the extend layer on my laptop (running Slackware). It works great with the CAPS-key as the switch. However, doing so triggers one question. I see that the extend layer is using the ISO_Level5_Shift generated when the key is held. However upon just hitting CAPS it triggers a ISO_Level5_Lock, that doesn't appear to be used?. Is there an easy way to map a key to that? 

Essentially I would like to have an escape if hitting the key briefly, being a heavy vim user an normally have ctrl+esc on that key. Having the extend layer is worth loosing the ctrl, but also losing escape is a bit much. ;)

Last edited by moesasji (16-Apr-2016 17:15:42)
Offline
  • 0
  • Reputation: 210
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,343

Hi, Moesasji!

The Caps key behavior is not defined in the symbols/extend file, but in symbols/lv5. There are many options for selecting level5–8 which I use for mapping the Extend layers. The one I use myself (and which is sort of a default for Extend) is caps_switch_lock:

// CapsLock chooses 5th level, latches (temp lock) when pressed with another 5th-level-chooser
partial modifier_keys
xkb_symbols "caps_switch_lock_cancel" {
  include "level5(lock)"
  key <CAPS> {
    type[Group1] = "EIGHT_LEVEL_LEVEL_FIVE_LOCK",
    symbols[Group1] = [ ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift,
                        ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock ]
  };
};

What this is supposed to do, is act like a switch when pressed, like a Shift key. When pressed together with another lv5 chooser, it'll lock the level5 like a CapsLock. But that means you have to have another lv5 chooser defined which most people don't bother with.

If it acts like a lock upon tapping, that's a bug in Slackware. You're free to edit the symbols/lv5 file to produce whatever you desire of course. ;-)

Several users want on-release mappings but I don't think xkb supports that out of the box. I personally don't trust such mappings for common keys at least, as they lead to misfires. But for something like you describe it might work well enough. What I'd do would be to not care about the last four levels (as they require another lv5 chooser) but map lv3–4 of the CapsLock key to 'Escape' instead of 'ISO_Level5_Shift'. Then, you'll get Esc from the Caps+AltGr combo.

However, I find it easier to just use the Extend layer as-is. I respect the Esc a lot, as my Extend Extreme topic hopefully shows. Therefore, both Caps+Q (for quick one-handed action) and Caps+[ are Esc in my Extend setup. In practice, Caps+Q works perfectly for me at least. I find it nearly as easy as tapping Caps, and far more robust.

Last edited by DreymaR (18-Apr-2016 08:18:22)

*** 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: 30-Jan-2016
  • Posts: 5

Thanks for the response DreymaR. I had indeed been looking at that level5 file, but I failed to make sense of it. Anyway having played with it a bit a came to the conclusion that I really want to keep CTRL+ESC on the CAPS-key (a single key press in easy reach over a combo wins for a key that I use so often). Xcape has been serving me well to do exactly this. 

So time to put the switch on another key. Using the right mouse-button that on a Thinkpad is below the thumb would have been ideal, but that doesn't appear to be an (easy) option as those unfortunately don't generate a key-code. :-( 

btw) my initial impression was wrong. According to xev the CAPS emits both an ISO_Level5_Shift as well as the ISO_Level5_Lock when I tap or press, so there is no difference. Anyway it no longer matters as having the switch there is too uncomfortable anyway.

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

Stevep99 has some work on modifiers on his github pages. One suggestion is to make the LAlt key your Extend modifier and tweak things around a little from there. That'd mean a more fanciful editing of the lv5 and other files, of course. I'm not all that interested in doing it until I see testimonies that it really really works in practice.

Last edited by DreymaR (19-Apr-2016 06:50:03)

*** 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: 975
DreymaR said:

Stevep99 has some work on modifiers on his github pages. One suggestion is to make the LAlt key your Extend modifier and tweak things around a little from there. That'd mean a more fanciful editing of the lv5 and other files, of course. I'm not all that interested in doing it until I see testimonies that it really really works in practice.

Only just noticed this as I was on holiday :)
Yes, what I do (on Linux) is just remap the keycodes for the modifier keys I want to change. I use the DreymaR's method of defining the level 5 modifier on CapsLock, but simply map CapsLock to LAlt using keycodes. I much prefer Extend on that key, but there are other possibilities.

Using this method would allow you to keep Esc on CapsLock if you wanted. But I also concur with DreymaR's suggestion that having Escape in the Extend layer is still very convenient. You could even map it so an easier key (instead of Extend-Q) if you felt the Q was not worthy enough.

Using Colemak-DH with Seniply.

Offline
  • 0
  • Reputation: 0
  • Registered: 11-Oct-2013
  • Posts: 79
stevep99 said:

Only just noticed this as I was on holiday :)
Yes, what I do (on Linux) is just remap the keycodes for the modifier keys I want to change. I use the DreymaR's method of defining the level 5 modifier on CapsLock, but simply map CapsLock to LAlt using keycodes. I much prefer Extend on that key, but there are other possibilities.

Using this method would allow you to keep Esc on CapsLock if you wanted. But I also concur with DreymaR's suggestion that having Escape in the Extend layer is still very convenient. You could even map it so an easier key (instead of Extend-Q) if you felt the Q was not worthy enough.

I like the idea of putting shift on LALt; I'll probably try that out at some point. At this point, I've pretty much managed to completely get rid of the need for my "Extend" layer.  I'll probably only start swapping it in when I'm forced to use software without proper text navigation capabilities and use caps as a different modifier (probably control which I'd use in some cases to do similar things as the Extend layer but with program-specific remappings). As a user of mostly vim-inspired software, I use escape a lot, so I disagree that having it on a layer is convenient. I think it's best put directly on a thumbkey or capslock. You can of course bind a key to both escape and a modifier with xcape on linux, karabiner on osx, and ahk on windows, so there's no need to put it on a layer in my opinion.

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

I gave the 'ghetto foot pedal' concept of Cevgar another spin in the weekend (that is, using a cheapo USB keyboard on the floor and peeling off some key caps so you can hit others easily with the feet). It's quite useful if you have keys you use a lot and want to give your hands a break! I may make a little writeup of it soon.

You could remap an Arrow key to Ext mod (as the arrows will be in your Extend layer anyway), and something else that your hands don't use much to Esc if you wish. Then you'd have everything, except it isn't so nice if you're on the move with laptops. Therefore, I personally am a bit loath to get used to such a solution.

Last edited by DreymaR (02-May-2016 11:04:11)

*** 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: 975
angelic_sedition said:

I like the idea of putting shift on LALt; I'll probably try that out at some point. At this point, I've pretty much managed to completely get rid of the need for my "Extend" layer.  I'll probably only start swapping it in when I'm forced to use software without proper text navigation capabilities and use caps as a different modifier (probably control which I'd use in some cases to do similar things as the Extend layer but with program-specific remappings). As a user of mostly vim-inspired software, I use escape a lot, so I disagree that having it on a layer is convenient. I think it's best put directly on a thumbkey or capslock. You can of course bind a key to both escape and a modifier with xcape on linux, karabiner on osx, and ahk on windows, so there's no need to put it on a layer in my opinion.

I think people often think too negatively about modifier keys - but this really only stems from the fact the most of the modifiers are in terrible locations on a standard keyboard.

For example, my backspace key is Extend-H (which on a "normal" keyboard would be the equivalent of LAlt-M). You might think that backspace, being a quite a common key (unless you are extremely accurate, which sadly I'm not) should have pride of place in the primary layer.  But actually Extend-H, despite being a two-key combo, is easier and more comfortable than the single default backspace key. I'd even go so far as to say it's probably better than over half of the single-keys on the keyboard.

That said, if you're not sold on Extend yet, then putting Escape on CapsLock sounds reasonable to me.

Last edited by stevep99 (02-May-2016 15:56:29)

Using Colemak-DH with Seniply.

Offline
  • 0