diff --git a/kmonad/.config/kmonad/dactyl.kbd b/kmonad/.config/kmonad/dactyl.kbd new file mode 100644 index 00000000..2cc7c484 --- /dev/null +++ b/kmonad/.config/kmonad/dactyl.kbd @@ -0,0 +1,31 @@ +(defcfg + input (device-file "/dev/input/by-id/usb-izwan_zwactyl_50_vial:f64c2b3c-event-kbd") + output (uinput-sink "My KMonad output") + + ;; Comment this if you want unhandled events not to be emitted + fallthrough true + + ;; Set this to false to disable any command-execution in KMonad + allow-cmd false +) + +(defsrc + caps a s d f g h j k l ; +) + +(defalias + ctl_a (tap-hold-next-release 200 a lctl) + alt_s (tap-hold-next-release 200 s lalt) + met_d (tap-hold-next-release 200 d lmet) + sft_f (tap-hold-next-release 200 f lsft) + + sft_j (tap-hold-next-release 200 j rsft) + met_k (tap-hold-next-release 200 k rmet) + alt_l (tap-hold-next-release 200 l ralt) + ctl_; (tap-hold-next-release 200 ; rctl) +) + + +(deflayer qwerty + esc @ctl_a @alt_s @met_d @sft_f g h @sft_j @met_k @alt_l @ctl_; +) diff --git a/kmonad/.config/kmonad/external_keyboard_script.sh b/kmonad/.config/kmonad/external_keyboard_script.sh index 0f897efa..2c9c929b 100755 --- a/kmonad/.config/kmonad/external_keyboard_script.sh +++ b/kmonad/.config/kmonad/external_keyboard_script.sh @@ -1,7 +1,12 @@ #!/bin/sh -device_name="platform-i8042-serio-0-event-kbd" +laptop="by-path/platform-i8042-serio-0-event-kbd" +dactyl="by-id/usb-izwan_zwactyl_50_vial:f64c2b3c-event-kbd" -if [ -e "/dev/input/by-path/${device_name}" ]; then - kmonad "${HOME}/.config/kmonad/config.kbd" +# This isn't an ideal solution. But the external keyboard gets high priority +# than the laptop keyboard, so check for that first. +if [ -e "/dev/input/${dactyl}" ]; then + kmonad "${HOME}/.config/kmonad/dactyl.kbd" +elif [ -e "/dev/input/${laptop}" ]; then + kmonad "${HOME}/.config/kmonad/laptop.kbd" fi diff --git a/kmonad/.config/kmonad/config.kbd b/kmonad/.config/kmonad/laptop.kbd similarity index 100% rename from kmonad/.config/kmonad/config.kbd rename to kmonad/.config/kmonad/laptop.kbd