From 4ac81c48b98853833e63fada2907bb6d6824e0e1 Mon Sep 17 00:00:00 2001 From: Sebastian Moser Date: Thu, 30 Jan 2025 20:23:20 +0100 Subject: [PATCH] keybard-flash script almost done --- scripts/keyboard-flash | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 scripts/keyboard-flash diff --git a/scripts/keyboard-flash b/scripts/keyboard-flash new file mode 100755 index 0000000..fcc9a8a --- /dev/null +++ b/scripts/keyboard-flash @@ -0,0 +1,32 @@ +#!/usr/bin/env bash + +CONFIG_REPO_LOCATION=~/work/config +CHARYBDIS_DISK_LOCATION=/dev/disk/by-uuid/0042-0042 + + +# use the fusefatfs packaged in my nurPkgs +alias fusefatfs="$(nix build ${CONFIG_REPO_LOCATION}#mynurPkgs.fusefatfs --no-keep-outputs --print-out-paths)/bin/fusefatfs" + + +# if we have a keyboard config like thing in the clipboard.... use that +if [[ "$(wl-paste | head -n 4)" == '#include +#include +#include +#include ' ]] +then + echo pasting keyboard config from clipboard + wl-paste > $CONFIG_REPO_LOCATION/zmk-config/config/charybdis.keymap +fi + +mkdir -p $TMP/keyboard-flash-mnt +exit + +sudo fusefatfs $CHARYBDIS_DISK_LOCATION $TMP/keyboard-flash-mnt + + +firmware_out_path=$(nix build .#random.keyboardRight -L --no-keep-outputs --print-out-paths) +echo firmware at: $firmware_out_path + +sudo cp $firmware_out_path #NEXT: what to copy where + +sudo umount $TMP/keyboard-flash-mnt