DreymaR / BigBagKbdTrixXKB

"DreymaR's Big Bag of Keyboard Tricks" for *nix with XKB
MIT License
200 stars 39 forks source link
colemak colemak-forums colemak-layout dreymar-big-bag ergo-modifications keyboard keyboard-layout xkb xkb-keyboard-layout xkb-layout

DreymaR's Big Bag of Keyboard Tricks


For Linux using XKB

The main Big Bag pages are found at https://dreymar.colemak.org/. To see XKB info boxes there, select the Tux platform icon.

Some info

Tips

localectl

Wayland & Friends

Wayland has a somewhat different tack: It uses xkb-data files, but not an X server. So the setkb script won't work there, but the BigBag as such will.

It depends on which Wayland Compositor you're using. Sorry, but I don't know them all. See its docs for more info?

For the popular Sway compositor, add a piece like this example to your ~/.config/sway/config file:

input * {
  xkb_model     pc105awide
  xkb_layout    us
  xkb_variant   cmk_ed_us
  xkb_options   lv5:caps_switch_lock,misc:extend,compose:menu
}

And here's one for Hyprland's ~/.config/hypr/hyprland file:

input {
    kb_rules=evdev
    kb_model=pc105awide
    kb_layout=us
    kb_variant=cmk_ed_dh
    kb_options=misc:extend,lv5:caps_switch_lock,compose:menu
    repeat_rate=40
    repeat_delay=200
}

The repeat settings are of course optional. Some like a higher repeat rate and a lower delay, and this is how to get that.

Here's a KDE Settings ~/.config/kxkbrc file. It can be set via the Settings GUI, or edited directly:

[$Version]
update_info=kxkb_variants.upd:split-variants,kxkb.upd:remove-empty-lists,kxkb.upd:add-back-resetoptions

[Layout]
DisplayNames=,
LayoutList=us,us
LayoutLoopCount=-1
Model=pc104awide
Options=grp:alt_shift_toggle,grp:win_space_toggle,caps:backspace,lv3:ralt_switch_multikey,compose:menu
ResetOldOptions=true
ShowFlag=false
ShowLabel=true
ShowLayoutIndicator=true
ShowSingle=true
Use=true
VariantList=cmk_ed_dh,

This one uses Caps as a Backspace. See the example above to upgrade it to an Extend key.

In NixOS without Wayland/Sway, services.xserver should work:

services.xserver = {
  layout = "us";
  xkbVariant = "cmk_ed_dh";
  xkbModel   = "pc105awide";
  xkbOptions = "misc:extend,lv5:caps_switch_lock,compose:menu";
};

To get the xserver layout in your console as well, use console.useXkbConfig in your configuration.nix file.

I guess the solution will be quite similar for other compositors, but I don't know more at the moment.

Links

See DREYMAR'S BigBag XKB topic on the Colemak Forums. There are plenty of explanations and further links in there.

TODO/DONE for this repo are found in the xmod folder README.

One good source of info on the xkb-data package is the xkeyboard-config repository itself, and its docs folder. The repo is found at GitLab.

Or, have a look in the X.Org Wiki. https://www.x.org/wiki/XKB/

Arch has good documentation on all things XKB. https://wiki.archlinux.org/title/X_keyboard_extension https://wiki.archlinux.org/title/Xorg/Keyboard_configuration

Ivan Pascal is a grandmaster of XKB; to learn it better you should definitely consult his site. Though maybe a bit less complete for us who can't read Russian, it's well worth it. http://pascal.tsu.ru/en/xkb http://pascal.tsu.ru/en/xkb/gram-symbols.html

Happy XKB hacking!
   DreymaR