• You are not logged in.

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

  • Started by DreymaR
  • 283 Replies:
  • Reputation: 12
  • Registered: 01-Apr-2018
  • Posts: 115

I wouldn't overcomplicate it if you can avoid that. You can always do some Hebrew letter substitutions in DreymaR's layout if you find that you need those characters more often than the ones that he set up. That way you would only have to deal with two, the custom layout, and QWERTY for others. Though you could simplify that even further and just let those plebeians suffer for their insistence on using such a lousy old layout. Then you only need one. :P

And where are my manners? I owe you a שלום. :)

Offline
  • 0
  • Reputation: 0
  • Registered: 18-May-2018
  • Posts: 5

Thanks azuvix - I just finished setting up a xubuntu 18.04 virtual machine to play with layouts, and also to experiment with storing my config files (dotfiles as they usually referred to as they begin with .something) in github for easy sync across machines and OS installs.

Offline
  • 0
  • Reputation: 20
  • Registered: 08-Oct-2017
  • Posts: 223
IvanS said:

Thanks azuvix - I just finished setting up a xubuntu 18.04 virtual machine to play with layouts, and also to experiment with storing my config files (dotfiles as they usually referred to as they begin with .something) in github for easy sync across machines and OS installs.

I prefer dots myself ;)

Offline
  • 0
  • Reputation: 96
  • From: Oslo, Norway
  • Registered: 13-Dec-2006
  • Posts: 4,563

Having multiple layouts with the Big Bag active is no problem. The only hurdle is if you're using keyboard models for ergo mods, then you'll have to make sure you switch those as well. But it's easily scriptable. Also, some functionality is buggy for the non-first layouts; this is an inherent XKB weakness. Not sure exactly what it entails.

I believe I have given examples of having multiple layouts active?

The Hebrew Colemak[eD] layout is still Work In Progress. We had some good collaboration on it but then my collaborator fell silent. I'd like to get it finished!

*** 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: 18-May-2018
  • Posts: 5

I almost never need to type hebrew, so that's a non issue for me (but I still want to be able to go back to "stock" when other family members want to use the laptop).
But if you need to do some testing - I'll be glad to help.

Now I have an interesting problem which couldn't resolve for several hours trying:
Lenovo Ideapad 510, I've installed the Big Bag successfully, but whenever I activate it with setxkbmap - I get 3 keys which fail to type uppercase ('Q','T/G', and '{'), this is both on qwerty and colemak layout.
When I launch and press those with Shift depressed, instead of normal key event I get something like this:

>xev -event keyboard
KeymapNotify event, serial 40, synthetic NO, window 0x0,
keys:  0   0   0   0   0   10   0   0   0   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0 

This happens on every run of setxkbmap, with any combination of options. And stays that way until I log-out and login.
OS is Linux Mint 18 x64 with XFCE DE.

Offline
  • 0
  • Reputation: 96
  • From: Oslo, Norway
  • Registered: 13-Dec-2006
  • Posts: 4,563

That's really really strange. I have no explanation for it. And those keys seem quite unrelated.

Could there be some sort of hotkey settings that interfere? But then why would they interfere only when setxkbmap has been run? Oddness.

*** 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: 17-Oct-2018
  • Posts: 3

Hello everyone,

First of all, I would like to thank DreymaR for his amazing contributions!
I have been using the colemak_ed version on Windows for a while now, the Extend layer is amazing.

I wanted to use it on Linux as well, with the following command:

setxkbmap -model pc105awide-sl -layout us -variant cmk_ed_us -option lv5:lalt_switch,misc:extend

But unfortunately, the Alt key doesn't work as a modifier for Extend. I have tried with CapsLock or RAlt as modifier, it works well. With Alt, it still operates as a classic Alt key (i.e. opening menus). Does anyone know what could be the issue?

Offline
  • 0
  • Reputation: 96
  • From: Oslo, Norway
  • Registered: 13-Dec-2006
  • Posts: 4,563
lv5:lsgt_switch_lock            =       +level5(lsgt_switch_lock)
lv5:ralt_switch_lock            =       +level5(ralt_switch_lock)
lv5:lwin_switch_lock            =       +level5(lwin_switch_lock)
lv5:rwin_switch_lock            =       +level5(rwin_switch_lock)
lv5:caps_switch_lock            =       +level5(caps_switch_lock)
lv5:lctl_switch_lock = +level5(lctl_switch_lock)

These are the switch rules defined in xkb/rules/evdev and that's what you have to choose between by way of lv5 switches from the GUI menu I think. In xkb/symbols/level5 you see some more that could be included in the options component. But as you can see, there's no rule for LAlt. So you can't get that without making one. And that's a bit technical.

You could, however, do a low-down dirty hack by piggybacking on an existing switch! Find the code in xkb/symbols/level5 that goes:

// The CapsLock key (while pressed) chooses the fifth shift level.
partial modifier_keys
xkb_symbols "caps_switch" {
  key <CAPS> {
    type[Group1]="ONE_LEVEL",
    symbols[Group1] = [ ISO_Level5_Shift ]
  };
  include "level5(modifier_mapping)"
};

Then change <CAPS> to <LALT> and it might just work... I hope. You'd choose "lv5:caps_switch" but it'd actually affect the LAlt key. I hope. ^_^

[edit: Hack confirmed! Well, that's nice! ^_^]

Last edited by DreymaR (18-Oct-2018 08:32:10)

*** 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: 17-Oct-2018
  • Posts: 3

Thank you so much! It works like a charm!

Offline
  • 0
  • Reputation: 52
  • From: UK
  • Registered: 14-Apr-2014
  • Posts: 659

I also use LAlt as my Extend modifier, it works very well!

My solution was slightly different: I wanted to also map the Left Alt function to the "left windows" key. To do this I simply changed scan code definitions of <LALT>, <LWIN> and <CAPS> in `keycodes/evdev`. Achieves pretty much the same result, but lets you move arbitrary modifier keys to where you want them.

Last edited by stevep99 (19-Oct-2018 16:33:36)

Using Colemak Mod-DH with some additional ergonomic keyboard mods.

Offline
  • 0
  • Reputation: 0
  • Registered: 22-Nov-2018
  • Posts: 1

Sorry if this has been covered, but I couldn't find it.

I have a keyboard with QMK configured to DHm.

I would like to use this file for my laptop keyboard, but not for my external keyboard.

How does it work? Are input keys overridden at a system level or per keyboard? I don't want this to affect my external keyboard.

Offline
  • 0
  • Reputation: 96
  • From: Oslo, Norway
  • Registered: 13-Dec-2006
  • Posts: 4,563

Since you're talking about controllers, maybe you'll want to read in the other Big Bag topic (the USB-2-USB aka TMK one) too for more info.

However, I'll answer your question briefly. A Human Interface Device (HID) whether connected with USB or PS/2 or another protocol, can only send input events such as key/mouse/joystick "clicks". The OS cannot to my knowledge (certainly not for USB devices) identify these events as they don't have a "source tag" on them.

So you're a bit out of luck in this: Your QMK keyboard will send the same kind of events as your laptop keyboard does, and I don't know of a way to make them behave differently short of having a hotkey to switch your system settings quickly.

One suggestion might be to put your QMK keyboard in "throughput" mode though. I'd have a simple QWERTY layout on a lockable QMK layer, so you can use the laptop and external keyboard interchangeably without wringing your head. I've been doing something like that on my work computers.

Last edited by DreymaR (23-Nov-2018 13:52:39)

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

Offline
  • 0
  • Reputation: 96
  • From: Oslo, Norway
  • Registered: 13-Dec-2006
  • Posts: 4,563

Did you look at my locale topic to see my suggestion for Croatian++?

To use left Alt as selector, you'd have to perform several tricks. Why not use the right Alt like most others do? Or, failing that, you could swap left and right Alt?

Making custom XKB layouts is ... interesting. You should read about it on the web before proceeding, if you're certain you want to go through with it. But basically, you could use my Croatian suggestion (I think the actual mappings are in the file for Serbian – yeah, I know, but deal with it please hehe), comment out what you don't want and add only those keys you want to change instead. Your special letters go on levels 3-4.

Last edited by DreymaR (18-Dec-2018 09:47:01)

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

Offline
  • 0
  • Reputation: 96
  • From: Oslo, Norway
  • Registered: 13-Dec-2006
  • Posts: 4,563

The DH mod is part of my install. So is the ANSI-AngleZ mod. What SteveP has on his page is not my business.

It's not that hard to add the Croatian letters, but did you see my suggestion and consider whether that may work for you?

file

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

Offline
  • 0
  • Reputation: 96
  • From: Oslo, Norway
  • Registered: 13-Dec-2006
  • Posts: 4,563

The Curl-DH mod needs an Angle mod to function normally. The Angle mods are different based on keyboard type/model and preference. This is described in the Big Bag.

So while I can't be sure what you're doing, I imagine that you didn't select a suitable CurlAngle model. For the AngleZ mod you need the pc104curl-z or pc104caw-zqu model depending on your Wide mod preference. In my setxkb.sh shorthand, that's 4c or 4cw.

Last edited by DreymaR (19-Dec-2018 09:22:12)

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

Offline
  • 0
  • Reputation: 96
  • From: Oslo, Norway
  • Registered: 13-Dec-2006
  • Posts: 4,563

I agree, that is even more confusing. Check the output from the command:

setxkbmap -v 9

Your bottom row is actually the dh-modded one, but without any Angle or CurlAngle mods. So it seems only your image is affected.

To make the settings permanent, I use a line in the ~/.bashrc file; it can be written by setxkb.sh once you find out what you need. It has come to my attention that since not all distros use Bash this isn't so robust, but I haven't found a better way yet. The reason I've opted for this solution is that it doesn't easily bork your system like some deeper-level methods may do (for instance if you select a layout and then it goes missing).

Last edited by DreymaR (20-Dec-2018 09:50:23)

*** 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: 20-Dec-2018
  • Posts: 3

b8rs2Uv.jpg

How do i get this layout? ive been trying to get it for a while but it doesnt seem 2 cooperate with me lol

https://i.imgur.com/b8rs2Uv.jpg

Last edited by colemaklover45 (20-Dec-2018 13:12:30)
Offline
  • 0
  • Reputation: 96
  • From: Oslo, Norway
  • Registered: 13-Dec-2006
  • Posts: 4,563

What was your activation command then? You're not telling me what you're doing so how should I know how to help you?

setxkb.sh 4c us us

This should activate an ANSI Curl-AngleZ Colemak[eD], with the US English layout. If you want it added to bashrc, add an -a switch before the shortstring.

@colemaklover: You're trying to do something a bit strange: Using Cmk-DH Wide but without an Angle mod. Why not use AngleZ and get better left wrist angles? If you're using an Angle cheat, then you can improve your typing experience by using a proper Angle mod. But to answer your question: I think you'd have to swap V and D in the symbols/colemak file, under the curl section.

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

Offline
  • 0
  • Reputation: 96
  • From: Oslo, Norway
  • Registered: 13-Dec-2006
  • Posts: 4,563
setxkb.sh 4c us us

Activate ANSI Curl-AngleZ Colemak[eD], with the US English layout. Just run the setxkbmap command to achieve this.

setxkb.sh -a 4c us us

Activate ANSI Curl-AngleZ Colemak[eD], with the US English layout. Add the setxkbmap command to ~/.bashrc so it gets run on logon.

*** 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: 20-Dec-2018
  • Posts: 3

@DreymaR Thanks for the response! Is 4cw the layout you are talking about?

Offline
  • 0
  • Reputation: 96
  • From: Oslo, Norway
  • Registered: 13-Dec-2006
  • Posts: 4,563

@colemaklover: Yes, that'd be the one. And if you want to skip Angle, it's just 4w.

@Anzick: Again, look at the 'setxkbmap -v 9' command. Don't give any other directives to it. Then it'll show you your configuration. Also pay attention to what setxkb.sh outputs.

*** 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: 20-Dec-2018
  • Posts: 3

how do you switch capslock to backspace

Offline
  • 0
  • Reputation: 96
  • From: Oslo, Norway
  • Registered: 13-Dec-2006
  • Posts: 4,563
colemaklover45 said:

how do you switch capslock to backspace

In symbols/colemak you'll find the line

// NOTE: In Linux, CapsLock is tweaked in the Keyboard settings (for freedom of choice etc.)
//    key <CAPS> { [     BackSpace,     BackSpace,           Caps_Lock,           Caps_Lock ] };

That'll do the trick for you when a Colemak[eD] layout is selected. But as it says in that line above, there should also be an Option to set the Caps key to whatever you want, independent on layout chosen. It should be in your keyboard settings GUI, or selectable by an option switch with setxkbmap.

In rules/evdev.lst you can see:

[...]
  caps:swapescape      Swap ESC and Caps Lock
  caps:escape          Make Caps Lock an additional Esc
  caps:backspace       Make Caps Lock an additional Backspace
  caps:super           Make Caps Lock an additional Super
  caps:hyper           Make Caps Lock an additional Hyper
  caps:menu            Make Caps Lock an additional Menu key
  caps:numlock         Make Caps Lock an additional Num Lock
  caps:ctrl_modifier Caps Lock is also a Ctrl
[...]

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

Offline
  • 0
  • Reputation: 96
  • From: Oslo, Norway
  • Registered: 13-Dec-2006
  • Posts: 4,563
Anzick said:
 setxkb.sh 4c us us
[...]
Applied rules from evdev:
rules:      evdev
model:      pc104curl-z
layout:     us(cmk_ed_us)
options:    misc:extend,lv5:caps_switch_lock,grp:shifts_toggle,compose:menu,misc:cmk_curl_dh
Trying to build keymap using the following components:
keycodes:   evdev(pc104curl-z)+aliases(qwerty)
symbols:    pc+us(cmk_ed_us)+inet(evdev)+group(shifts_toggle)+compose(menu)+level5(caps_switch_lock)+extend(basic)+colemak(cmk_ed_dh)
geometry:   pc(pc104curl-z)

ok now i am noticing that my issue is so far occurring in terminal and standard notes app, but in konsole and browser it works correctly...even more confusing. How do i make a custom layout that i can select in keyboard layout settings like you have done?

So, the above output looks perfect. It makes an ANSI-Curl(DH)-Angle(Z)-Colemak[eD] US layout w/ Extend, as it should.

Why it works differently in terminal/notes from in konsole/browser, is beyond me. Does your terminal have a .rc file you could add the .bashrc line to? If your settings GUI lets you choose both keyboard model, layout and the relevant options then you can use that – but for some reason several of the settings GUIs I've seen lately have been dumbed down so they're less useful. :-(

Making layouts like I have done is wayyy beyond the scope of a forum reply, unfortunately. It's a rather complex task. Read up on the Arch Linux xkb FAQ and other relevant sources. If you don't want all that hardship, just tweak one of mine instead.

Last edited by DreymaR (24-Dec-2018 15:41:24)

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

Offline
  • 0
  • Reputation: 96
  • From: Oslo, Norway
  • Registered: 13-Dec-2006
  • Posts: 4,563

The .bashrc command is reversed by commenting out or deleting the setxkbmap line in the .bashrc file then logging out and in again.

The layout will be in the xkb/symbols/colemak file. Again, try to read up and learn for yourself if you want to do this, instead of asking me exactly what to do. I can't hold your hand through all the steps.

Last edited by DreymaR (31-Dec-2018 18:26:27)

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

Offline
  • 0