From f39dc4e6c7bd61d5c04a2aa424c3f15981ef4790 Mon Sep 17 00:00:00 2001 From: 28allday Date: Sat, 13 Jun 2026 20:51:21 +0100 Subject: [PATCH] packaging: dev-sync.sh background loop for seamless live VM preview Co-Authored-By: Claude Opus 4.8 (1M context) --- packaging/dev-sync.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 packaging/dev-sync.sh diff --git a/packaging/dev-sync.sh b/packaging/dev-sync.sh new file mode 100644 index 00000000..8fc1d3a6 --- /dev/null +++ b/packaging/dev-sync.sh @@ -0,0 +1,23 @@ +#!/bin/sh +# dev-sync.sh — background loop for the live VM preview. Copies the fork's QML +# from the 9p mount (/mnt/fork) into the LOCAL quickshell config so quickshell's +# file-watcher (settings.watchFiles) auto-reloads on host-side edits. 9p doesn't +# propagate inotify, so we poll + copy to a local dir where inotify works. +# +# Run once in the VM (after dev-mount.sh has set up the local config copy): +# setsid sh /mnt/fork/packaging/dev-sync.sh >/dev/null 2>&1 & +# +# Then just edit the fork on the HOST — the VM shell reloads within ~2s. +set -eu +SRC=/mnt/fork +DST="$HOME/.config/quickshell/caelestia" + +[ -e "$SRC/shell.qml" ] || { echo "9p fork not mounted at $SRC" >&2; exit 1; } +[ -d "$DST" ] || { echo "$DST is not a local dir — run dev-mount.sh's local-copy step first" >&2; exit 1; } + +while true; do + for d in shell.qml modules components services utils assets; do + [ -e "$SRC/$d" ] && cp -ru "$SRC/$d" "$DST/" 2>/dev/null || true + done + sleep 1.5 +done