first commit

This commit is contained in:
2026-05-27 18:50:35 +09:00
commit d80de116c6
17 changed files with 1381 additions and 0 deletions

16
run.sh Executable file
View File

@@ -0,0 +1,16 @@
#!/bin/sh
set -u
cd "$(dirname "$0")"
# First run only: install a udev rule (one sudo prompt) so your user — in the
# input group — can open the keyboard without root. Later runs skip this.
rule=/etc/udev/rules.d/70-hhkb.rules
if [ ! -e "$rule" ]; then
echo "first run: installing $rule"
echo 'KERNEL=="hidraw*", ATTRS{idVendor}=="04fe", MODE="0660", GROUP="input"' >/tmp/hhkb.rules
sudo sh -c "mkdir -p ${rule%/*} && cp /tmp/hhkb.rules $rule && udevadm control --reload-rules && udevadm trigger --settle"
rm -f /tmp/hhkb.rules
fi
go build -o hhkb-web ./cmd/hhkb-web || exit 1
exec ./hhkb-web "$@"