From a5761f08c90ac552134c0a3ff594a3be05b0bfdc Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Wed, 15 Jan 2025 16:37:07 +0900 Subject: [PATCH 1/3] Add note about how to escape from kanata trouble --- config/keyboards/README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/config/keyboards/README.md b/config/keyboards/README.md index 3d9d0b40..528897fc 100644 --- a/config/keyboards/README.md +++ b/config/keyboards/README.md @@ -6,6 +6,19 @@ TODO: UPDATE ME with extracting from NixOS Config ## Kanata +Force exiting if I have faced to similar problems like GH-963 + +`Left Control` + `Space` + `Esc` + +Then the process will die. You can restart it with `systemctl start kanata-all`. +Not just the `kanata`. You can check it with `systemctl list-unit-files "kanata*`. + +```console +> systemctl list-unit-files "kanata*" +UNIT FILE STATE PRESET +kanata-all.service enabled ignored +``` + ## NixOS It generates whole config from [partial config file](kanata.kbd). From 3fe5928745e23a7e836a2b327d9eb1e7bc580f29 Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Wed, 15 Jan 2025 16:48:59 +0900 Subject: [PATCH 2/3] Simply add link for HWDB method --- config/keyboards/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/keyboards/README.md b/config/keyboards/README.md index 528897fc..7b5e3b0c 100644 --- a/config/keyboards/README.md +++ b/config/keyboards/README.md @@ -2,7 +2,7 @@ ## HWDB -TODO: UPDATE ME with extracting from NixOS Config +See [the definitions](https://github.com/search?q=repo%3Akachick%2Fdotfiles+extraHwdb&type=code) ## Kanata From 17e174f65ff13c4e70f168c54db31c7b58633075 Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Wed, 15 Jan 2025 17:18:54 +0900 Subject: [PATCH 3/3] Add escape hatch from kanata and caps lock trouble --- config/keyboards/kanata.kbd | 11 ++++++++--- nixos/desktop/kanata.nix | 4 +++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/config/keyboards/kanata.kbd b/config/keyboards/kanata.kbd index 62b8a719..1ea99e57 100644 --- a/config/keyboards/kanata.kbd +++ b/config/keyboards/kanata.kbd @@ -1,8 +1,8 @@ -;; (defcfg) ;; Enable this line except use via nix +(defcfg concurrent-tap-hold yes) ;; Required to specify keys which should be considered in tap-hold-press (=spc, tab for alt-spc, alt-tab) ;; See https://github.com/jtroo/kanata/blob/fc850fab9da7d0bf377e215f0b923062e037ff64/docs/config.adoc?plain=1#L142-L143 -(defsrc caps lalt ralt spc tab) +(defsrc caps lalt ralt spc tab f1 a c) (defvar tap-timeout 200 @@ -13,8 +13,13 @@ (deflayermap (base) ;; Avoiding tap-hold for caps to make stable behavior - ;; TODO: Add escape hatch for use of caps. See GH-963 caps lctl lalt (tap-hold-press $tt $ht muhenkan lalt) ralt (tap-hold-press $tt $ht henkan ralt) ) + +;; Escape hatch for use of caps. See GH-963 +(defchordsv2-experimental + ;; Don't use caps for inputs combination + (f1 c a) caps 500 all-released () +) diff --git a/nixos/desktop/kanata.nix b/nixos/desktop/kanata.nix index 789368b4..8034ce42 100644 --- a/nixos/desktop/kanata.nix +++ b/nixos/desktop/kanata.nix @@ -10,11 +10,13 @@ # https://github.com/NixOS/nixpkgs/pull/354894 # https://github.com/NixOS/nixpkgs/pull/351675#issuecomment-2440047546 package = pkgs.unstable.kanata; # TODO: Use stable since nixos-25.05 + keyboards = { # Intentionally setting alt to henkan and muhenkan even in JIS layouts to consider my mis-typing # tap-hold-press: tap-next in kmonad. See https://github.com/jtroo/kanata/issues/7#issuecomment-1196236726 all = { - config = builtins.readFile ../../config/keyboards/kanata.kbd; + # Don't use extraDefCfg to share same config with Windows and darwin + configFile = ../../config/keyboards/kanata.kbd; }; }; };