6

Nix Colemak-DH layout

 1 year ago
source link: https://sbulav.github.io/nix/nix-colemak-dh/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Nix Colemak-DH layout

2 minute read

NixOs is gaining a lot of attentions right now. I’ve also decided to try to use is as my daily driver. I won’t go into the details of installation of nixos, or setting up flake. Check out Introduction to Nix & NixOS free ebook and Nix starter configis

As I use Colemak Mod-DH layout, this was must-have first step for me to configure.

Obviously, [DreymaR’s Big Bag of Keyboard Tricks](https://github.com/DreymaR/BigBagKbdTrixXKB] didn’t work on NixOS, and I couldn’t find an existing solution for this.

So I’ve created a custom layout based on the [DreymaR’s Big Bag of Keyboard Tricks](https://github.com/DreymaR/BigBagKbdTrixXKB].

  • Create layout file symbols/colemak_dh with the DH symbols:
default partial alphanumeric_keys

// overwrite some keys with the Mod-DH config
xkb_symbols "dh" {
	// get the base colemak layout
	include "us(colemak)"
	// use AltGr as a 3rd modifier
//include "level3(ralt_switch)"
//AB lowest row, see https://www.charvolant.org/doug/xkb/html/node5.html
//12345678
//zxcdvkh,
    key <AB01> { [             z,             Z,               U0292,               U01B7 ] }; // QWE Z Cmk zZ ʒƷ
    key <AB02> { [             x,             X,              dagger,        doubledagger ] }; // QWE X Cmk xX †‡
    key <AB03> { [             c,             C,           copyright,                cent ] }; // QWE C Cmk cC ©¢
    key <AB04> { [             d,             D,                 eth,                 ETH ] }; // QWE/Cmk V
    key <AB05> { [             v,             V,            division,         Greek_gamma ] }; // QWE/Cmk B
    key <AB06> { [             k,             K,            ccedilla,            Ccedilla ] }; // QWE N Cmk kK çÇ
    key <AB07> { [             h,             H,             hstroke,             Hstroke ] }; // QWE/Cmk M
    key <AC05> { [             g,             G,                 eng,                 ENG ] }; // QWE G Cmk D
    key <AC06> { [             m,             M,            multiply,           downarrow ] }; // QWE/Cmk H
    key <AD05> { [             b,             B,  enfilledcircbullet,          Greek_beta ] }; // QWE T Cmk G
    key <CAPS> { [    Escape,    Escape,       Escape,        Escape ] };
};
  • Define extra custom layouts that will be included in the xkb configuration:
services.xserver.extraLayouts.dh = {
  description = "Colemak-DH ergo";
  languages = ["eng"];
  symbolsFile = ../symbols/colemak_dh;
};
  • Define keyboard layout for xserver:
services.xserver = {
  layout = "dh,ru";
  xkbOptions = "terminate:ctrl_alt_bksp";
};
  • Configure layouts for your Display Server(I am using Hyprland):
# For all categories, see https://wiki.hyprland.org/Configuring/Variables/
input {
    kb_layout = dh,ru
    kb_options = caps:none,grp:win_space_toggle,caps:escape
}
  • Finally, configure icons and switch in your bar(I am using Waybar):
"hyprland/language" = {
  "format-en" = "  dh";
  "format-ru" = "  ru";
  "keyboard-name" = "at-translated-set-2-keyboard";
  on-click = "${hyprctl} switchxkblayout at-translated-set-2-keyboard next";
};

I also tried setting up 3 layouts, but switching between them seems to be broken. Anyway, this short steps could help you in setting Colemak-DH or any other custom layout in NixOS.


Recommend

  • 114
    • blog.nickpierson.name 7 years ago
    • Cache

    My .vimrc (Colemak Edition)

    A vimrc for Colemak users, explained.

  • 68
    • matthewbauer.us 6 years ago
    • Cache

    bauer: an Emacs+Nix IDE

    My Emacs configuration

  • 37
    • www.tuicool.com 6 years ago
    • Cache

    Nix, Docker and Haskell

    I have slowly been converting my services to being deployed using Nix and Docker and found that the resources on the topic are not quite as extensive as I would have wanted when I started. Traditionally, tutorials seem to...

  • 48
    • Reddit www.reddit.com 6 years ago
    • Cache

    Custom colemak and vim are best friends : Colemak

    r/Colemak: A subreddit concerning Colemak, a modern alternative to the QWERTY and Dvorak keyboard layouts. |Colemak is designed both for efficient and ergonomic touch typing in English, and to provide QWERTY users an easier transition. Among ot...

  • 41
    • www.tuicool.com 6 years ago
    • Cache

    Colemak-Steno Hybrid in QMK

    Planck keyboard with steel plate, milled aluminum bottom, and modded XDA-profile key caps QMK Firmware The...

  • 25
    • www.srid.ca 5 years ago
    • Cache

    Nix recipes for Haskellers

    The goal of this article is to get you comfortable managing simple Haskell programs and projects using the Nix package manager without going too much into the details. Using li...

  • 16
    • christine.website 5 years ago
    • Cache

    I was Wrong about Nix

    From time to time, I am outright wrong on my blog. This is one of those times. In mylast post about Nix, I didn’t see the light yet. I think I do now, and I’m going to attempt to clarify below. Let’s talk about a...

  • 13
    • clux.github.io 4 years ago
    • Cache

    Colemak Switchover

    Colemak SwitchoverMaking useless optimizations since 2013 Posted on March 20, 2013  (Last modified on December 12, 2018)  |  clux

  • 7

    QWERTY is the worst keyboard layout. A learning Colemak Odyssey 15.03.2021 0 comments 356 days since last revision....

  • 5

    Makes the KeyBR Colemak Layout be Colemak-DH on an ANSI Keyboard. Install with TamperMonkey · GitHub Instantly share co...

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK