• You are not logged in.

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

  • Started by DreymaR
  • 348 Replies:
  • Reputation: 0
  • Registered: 28-Apr-2019
  • Posts: 4

@DreymaR Ok, I solved it all by removing the actions of my custom keys in xkb/symbols/extend (replacing them by NoAction()).

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

Well, in that case I guess you could've just commented out those keys altogether? But it's nice that you got it to work, grats with that!

*** 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: 14-Jun-2019
  • Posts: 1

Hi everyone, I've read through the instructions and I'm lost with the combination for setting my preferred colemak layout, can someone post a setxkbmap command for it? I'd really appericate it! mod_dh_keyb_ansi_wide.png

Offline
  • 0
  • Reputation: 136
  • From: Oslo, Norway
  • Registered: 13-Dec-2006
  • Posts: 4,895
shay said:

I've read through the instructions and I'm lost with the combination for setting my preferred colemak layout...

Hi! What you have there is an ANSI-CurlAngle(Z)Wide(/) Colemak, but with SteveP's preferred placement of 6 vs =. In my opinion using the right hand on the 6 key is wrong for standard row-staggered boards since the distance from the home position is greater for the right hand and the physical middle of the board is between the 6 and 7 keys so to speak. So I haven't implemented the 6-to-the-right Wide option everywhere.

$> ./setxkb.sh 4cw

This command activates my version of ANSI-CAW[eD]. See the setxkb help text to make it permanent by adding a line to your ~/.bashrc file. If you want the swapped 6 and = keys you may edit the symbols/colemak file to achieve this by swapping the key codes for those keys (it'll affect all Colemak[eD] layouts but that may be okay?). Look around in there and see if you can figure out how.

*** 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: 19-Sep-2019
  • Posts: 2

Hi,

thanks for the extend layer. Getting all those editor-independent movement keys at my fingertips is awesome.

I let install-dreymar-xmod.sh patch the xkb files and set the default layouts and options from /etc/default/keyboard like

XKBMODEL="pc105"
XKBLAYOUT="us,us,de"
XKBVARIANT="colemak,basic,basic"
XKBOPTIONS="terminate:ctrl_alt_bksp,grp:sclk_toggle,grep_led:caps,misc:extend,lv5:caps_switch_lock"

I have two annoying problems, that I don't know how to tackle:

1. My Fn keys below F8 do not work as soon as I add the misc:extend option.
   (Same for CAPS-1..7, only CAPS-8..0 generate F8..F10 keypresses)?

2. Keyboard repeat seems to be disabled for most keys (independent of whether the extend option is there or not, only dependent on whether patches are applied).

    xset reports some sort of a mask?

   

 $ xset q
[...]
auto repeating keys:  0001c000100000a0
                      0080ff6ffeedffff
                      9fffffffffffffff
                      ff77ffffffffffff
[...]

I am a bit at a loss on how to debug that. I suppose commenting out the multimedia keys in your config works towards 1, but I am at a loss for 2.

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

Glad you enjoy it! Unfortunately, I'm not sure about the repeat thing, it puzzles me as well. I think it may be about key types but that's as far as I got. Yeah, that mask is certainly interesting.

Really not sure why my files should bork only F1–F7 for you either. That makes no sense to me. Sorry.

Last edited by DreymaR (19-Sep-2019 15:15:11)

*** 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: 19-Sep-2019
  • Posts: 2

As an additional data point worth noting, I found that the generated xkb layout by klfc does NOT affect the key repeat! And the CAPS-1..7 keys do produce F1..7, which is good enough for me for the time being.

The regular F1..7 don't work either. Probably some interference with the multimedia keys of this Thinkpad.

Last edited by coroa (19-Sep-2019 15:24:39)
Offline
  • 0
  • Reputation: 0
  • Registered: 02-Jul-2017
  • Posts: 3

Hey there Dreymar, thanks again for this great tool, been using it for long time already but on Windows. I switched to Linux and I wanted to use it differently here. My config right now is:

./setxkb.sh 5c us us

and I want to use the extend key on the LAlt key place, and have the LAlt mapped to CapsLock. Before applying your script, I successfully swap the behaviour of those keys via editing /usr/share/X11/xkb/keycodes/evdev , but after using the install-dreymar-xmod.sh script that no longer works, so I'm a bit stucked over here...  Please help me, what files do I need to manually edit in order to do that, and what else do I have to do to make this changes permanently for my user? Cheers! Thank you so much again.

Last edited by crisgon (11-Nov-2019 03:02:27)
Offline
  • 0
  • Reputation: 136
  • From: Oslo, Norway
  • Registered: 13-Dec-2006
  • Posts: 4,895

I guess my files just overwrote your changed evdev file? Have you checked it after installing the BigBag? Your change should affect the PC105 model, make sure it does that. Keycodes is a good place to swap "hard" key behavior.

My CurlAngleWide mods are implemented as keyboard models (like PC104/ANSI and PC05/ISO) but these inherit from the basic ANSI/ISO models so if your change is done to those it should come through just fine.

If you use a US layout, are you sure you're on an ISO board? If you're on an ANSI keyboard you probably don't want the 5c but 4c model?

To make the changes permanent, there's an option in setxkb.sh to write the setxkbmap command string to your ~/.bashrc file. If you use another logon file, copy the line to that.

Last edited by DreymaR (12-Nov-2019 12:24:15)

*** 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: 02-Jul-2017
  • Posts: 3

Hey again Dreymar, thanks for your reply. Yes, I have an ISO Latin American Keyboard, so 105 fits me. I was using your script without any hassle yesterday, however when I went to turn on my computer, Linux wont boot, it stays frozen after loading modules (I'm not sure exactly what it does when boots up), says:

bluetooth hci0 failed to send firmware data (-110)

I tried to find solutions on the internet but couldn't find anything similar. I don't use bluetooth but it wasn't giving me errors either. This was after applying your scripts, I can confirm this behaviour because I have used ElementaryOS and Ubuntu before (now I'm using Pop! OS) and got the same errors after rebooting the system. I thought this was because of my battery draining down to zero after having it suspended, but today I just confirmed that is this script that is making my laptop not to boot.

Do you have any idea what could be causing this issue? I really want to use the extend key and colemak itself, but I dont want to use Windows again.

PS: I wrote you on Discord.

UPDATE: After reinstalling Pop! OS and successfully logging in, I tried and run install-dreymar-xmod.sh -ox, set the layout to 5c us us, rebooted and again getting the same error. Meanwhile I found an xmodmap that maps keys to the desired but no Extend super powers for me. I'd really appreciate your help.

Last edited by crisgon (12-Nov-2019 22:57:02)
Offline
  • 0
  • Reputation: 136
  • From: Oslo, Norway
  • Registered: 13-Dec-2006
  • Posts: 4,895

Well, that's just weird. My script doesn't do anything to any bluetooth stuff. Have you run the script with normal admin rights? It should ask for a sudo password. If any of the X11 files change ownership you could get trouble.

*** 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: 25-Jan-2020
  • Posts: 7

Thank you very much for your wonderful work. How can I change the layout toggle key from capslock to space like touchcursor under Windows, and use capslock for backspace? Thank you for your time.

Last edited by makdhfan (25-Jan-2020 21:10:38)
Offline
  • 0
  • Reputation: 136
  • From: Oslo, Norway
  • Registered: 13-Dec-2006
  • Posts: 4,895

I don't know what 'touchcursor under Windows' is, but I haven't got a way to make a key dual-function if that's what you're getting at. I'd suggest swapping LAlt and Caps instead, which can be done in the keycodes component.

However, why would you want the Caps key to be a primitive Backspace when it can be a glorious Extend key instead?  /(⁎≧∇≦)\

*** 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: 25-Jan-2020
  • Posts: 7
DreymaR said:

I don't know what 'touchcursor under Windows' is, but I haven't got a way to make a key dual-function if that's what you're getting at. I'd suggest swapping LAlt and Caps instead, which can be done in the keycodes component.

However, why would you want the Caps key to be a primitive Backspace when it can be a glorious Extend key instead?  /(⁎≧∇≦)\

Thank you. It's mostly a habit thing from original colemak. Plus, with capslock mapped to backspace, I can concentrate a lot of editing shortcuts to my left hand area on the keyboard. And my right hand would use the mouse. Also, It's very cold where I live so having only one hand out is ideal sometimes. :)

My extend key was "space down" in Windows, and space would be "space down and then up without key presses in between". Touchcursor is a program in Windows that does this for me.

Could you please tell me more on how to change capslock to backspace with your xkb files? I couldn't figure out which files to edit. Thank you.

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

For Linux, you don't have to edit anything. The function of the Caps key is a separate xkb "-option" setting. If you don't have it in your keyboard settings GUI then setxkbmap can be used. It's the caps:#### stuff, as here taken from rules/evdev.lst:

Spoiler:

caps                 Caps Lock behavior
  caps:internal        Caps Lock uses internal capitalization; Shift "pauses" Caps Lock
  caps:internal_nocancel Caps Lock uses internal capitalization; Shift does not affect Caps Lock
  caps:shift           Caps Lock acts as Shift with locking; Shift "pauses" Caps Lock
  caps:shift_nocancel  Caps Lock acts as Shift with locking; Shift does not affect Caps Lock
  caps:capslock        Caps Lock toggles normal capitalization of alphabetic characters
  caps:shiftlock       Caps Lock toggles ShiftLock (affects all keys)
  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
  caps:none            Caps Lock is disabled

Unfortunately, some of the Colemak XKB layout implementations hard code Caps key behavior instead of playing by these rules.

Last edited by DreymaR (27-Jan-2020 12:46:18)

*** 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: 25-Jan-2020
  • Posts: 7
DreymaR said:

For Linux, you don't have to edit anything. The function of the Caps key is a separate xkb "-option" setting. If you don't have it in your keyboard settings GUI then setxkbmap can be used. It's the caps:#### stuff, as here taken from rules/evdev.lst:

Spoiler:

caps                 Caps Lock behavior
  caps:internal        Caps Lock uses internal capitalization; Shift "pauses" Caps Lock
  caps:internal_nocancel Caps Lock uses internal capitalization; Shift does not affect Caps Lock
  caps:shift           Caps Lock acts as Shift with locking; Shift "pauses" Caps Lock
  caps:shift_nocancel  Caps Lock acts as Shift with locking; Shift does not affect Caps Lock
  caps:capslock        Caps Lock toggles normal capitalization of alphabetic characters
  caps:shiftlock       Caps Lock toggles ShiftLock (affects all keys)
  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
  caps:none            Caps Lock is disabled

Unfortunately, some of the Colemak XKB layout implementations hard code Caps key behavior instead of playing by these rules.

I'll definitely try this the next time I work with a physical Linux machine. Thank you so much for taking the time to educate me. You cannot believe how grateful I am. Thank you.

Offline
  • 0
  • Reputation: 0
  • Registered: 08-Feb-2020
  • Posts: 1

Massive thanks to DreymaR for this great big bag of keyboard tricks!

I'm trying to bind keys to "copy" and "paste". I've gotten some clues from the guide to XKB and reading evdev. However, I don't know how to bind one key to ctrl+c down & up. Any ideas?

I'm using "pc104curl-z" on Cinnamon.

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

Look in my /symbols/extend file, there are a lot of working bindings. Of course, I'd just recommend using Extend Copy/Paste...  ¯\_(ツ)_/¯

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

Hey, love this! The extend layout is amazing. I was having one issue though. My equal key isn't working. Well actually the key works, as I can still type + with shift, but I can't type the unshifted equal sign. I initialized the keyboard with "setxkbmap -model 4". Model 5 does not work either. Strangely enough, the key does work with the colemak[eD] layout. Any help with this appreciated, and apologies if this has already been asked by someone else and I missed it, it's late and I'm pretty tired.

Edit: Btw, are there any developers here that have figured out a good extend layout for programming in java/python?

Last edited by Crazycrabman (27-Feb-2020 09:43:59)
Offline
  • 0
  • Reputation: 0
  • Registered: 13-Apr-2020
  • Posts: 1

Would you mind helping me set up this thing? I've fiddled with it around for a bit, but I can't seem to make this work the way i want to =(

I've downloaded your script and installed it ( -ox ), i think it is currently properly installed (because i can use the setxkbmap to change my layouts to the new colemak you have setup)

idk if it matters or not, but i use fcitx to alternate between "System Keyboard" and Japanese (Mozc)

EDIT:
i managed to fix my issues i think, it was related to fcitx i had to change the default option there too!
but minor side note, i can't seem to type space if i ever switch to qwerty again (which i do for gaming, but atm i can't jump at all in some games :D)

also... did i understand DH mod wrongly? my bottom row is currently zxcvd instead of zxcdv (accordingly to the github page)

thanks and sorry for bothering

Last edited by xendak (13-Apr-2020 02:19:30)
Offline
  • 0
  • Reputation: 136
  • From: Oslo, Norway
  • Registered: 13-Dec-2006
  • Posts: 4,895

If your bottom row doesn't show the right ergo mod that may be because you didn't set the model. By using the setxkb script you can add a line to ~/.bashrc that runs a setxkbmap command on each startup. Without it, all the changes will probably not be persistent across logons. If you have a matrix board and don't want an Angle mod, then I suggest editing the symbols/colemak file.

*** 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: 19-Apr-2020
  • Posts: 2

How would I go about using xsetkbmap to change my layout to Colemak DH without the angle mod? I am using an ANSI keyboard and I'm used to the columns as they are (there's no extra keys by the right shift also). I can set the keymap to Colemak but I can't seem to get the dh swap to work. I'm using Arch Linux with i3 and I installed the package using the AUR. Also, I have a keyboard running QMK using Colemak through firmware mapping and might end up using it on my laptop occasionally. Is there a way to set a map only for the internal keyboard in case I use an external keyboard on it?

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

Unless you're using a matrix board, you kind of need an Angle mod for DH to work for you. Otherwise you'll make a stretch to D and the stretch to V will be too long. Since Z is rare, using the ANSI Angle(Z) mod is the best option. You could implement what you want by editing the symbols/colemak file and not setting a different model at all, since the ergo mods are implemented as keyboard models.

I'm not sure which AUR (Arch User Repository?) you've used, but I never made one. My repo is on GitHub. Are you sure you aren't confusing my Colemak implementation with the standard one in Linux? The latter has no ergo mods nor anything fancy at all.

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

Offline
  • 0
  • Reputation: 74
  • From: UK
  • Registered: 14-Apr-2014
  • Posts: 773
LinuxFish said:

How would I go about using xsetkbmap to change my layout to Colemak DH without the angle mod? I am using an ANSI keyboard and I'm used to the columns as they are (there's no extra keys by the right shift also).

The angle mod is integral to Colemak DH. When you say you are used to the columns as they are, does that mean you type C with your middle finger currently? Or perhaps your are doing the 'angle cheat' method and using your index finger. Bear in mind Colemak (and Qwerty) is designed assuming middle finger C.

If you are wedded to keeping ZXCVB absolutely unchanged, then I'd recommend applying Colemak-DH on the right hand only, and then the D>P>G rotation on the left hand. That solution is not quite as good but it offers some improvement for people who are dead against the angle mod.

Last edited by stevep99 (20-Apr-2020 16:21:00)

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

Offline
  • 0
  • Reputation: 0
  • Registered: 19-Apr-2020
  • Posts: 2

I usually use an ortholinear board so I use the correct fingers for all the keys. I would like to keep the columns the same (ie no angle mod) on my laptop because I have an ansi layout on the laptop and I have no good place to put the z key if I apply the angle mod. If I could graft a planck into my laptop that would be the best solution but I don't think it's very practical to bring a separate keyboard with me at all times.

It might be easiest if I went with creating a custom keymap (similar to the not so fancy colemak implementation which ships with linux) as I don't really need all the fancy features included in the big bag. If I'm going to be typing a lot I'll probably be using my custom keeb which can have all the fancy features implemented in firmware on top of being much more ergonomic than only applying the angle mod.

Basically, is there a keymap file which already exists which does what I'm trying to do or any kind of simpler way to modify the keymap other than blindly changing things in the keymap and hoping for the best? I can probably figure it out on my own, but any help in figuring it out will save a lot of time in trial and error.

Offline
  • 0