diff --git a/README.md b/README.md index fee2218..b8d5354 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ QLC+ show files, fixture definitions, and generators for the XCHC stage ``` fixtures/ Fixture definitions (.qxf) — install into QLC+ if needed -rgbscripts/ RGB matrix scripts; scripts/shows/can_patterns.py links them into ~/.qlcplus/rgbscripts +rgbscripts/ RGB matrix scripts; scripts/install_qlcplus.sh links them into ~/.qlcplus/rgbscripts shows/ Workspaces to open in QLC+ xchc.qxw Main show (patterns + movers, unified VC) simple.qxw Manual board: M1/M2 pads, shared + individual RGBW @@ -23,6 +23,14 @@ tests/ Art-Net / fixture helpers used by scripts ## Open in QLC+ +On a new machine, link the RGB scripts, fixtures and pad input profile into +`~/.qlcplus` first, then (re)start QLC+. Without `rgbscripts/steps.js` and +`swap.js` the can patterns load but do nothing. + +```bash +scripts/install_qlcplus.sh +``` + - Full show: `shows/xchc.qxw` - Simple RGBW + positions: `shows/simple.qxw` diff --git a/scripts/install_qlcplus.sh b/scripts/install_qlcplus.sh new file mode 100755 index 0000000..f2880aa --- /dev/null +++ b/scripts/install_qlcplus.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +# Link this repo's RGB scripts, fixtures and input profiles into ~/.qlcplus, +# where QLC+ looks for them. The shows' can patterns use rgbscripts/steps.js +# and swap.js, so without them those matrices do nothing. Restart QLC+ after +# running this: it reads these folders at startup. +# +# scripts/install_qlcplus.sh # link what is missing; keep files that differ +# scripts/install_qlcplus.sh --force # replace files that differ with links +set -euo pipefail + +ROOT="$(cd "$(dirname "$0")/.." && pwd)" +USER_DIR="$HOME/.qlcplus" +FORCE= +[[ "${1:-}" == "--force" ]] && FORCE=1 + +for dir in rgbscripts fixtures inputprofiles; do + mkdir -p "$USER_DIR/$dir" + for src in "$ROOT/$dir"/*; do + dest="$USER_DIR/$dir/$(basename "$src")" + if [[ -L "$dest" && "$(readlink -f "$dest")" == "$src" ]]; then + continue + fi + if [[ -e "$dest" && ! -L "$dest" ]] && ! cmp -s "$src" "$dest" && [[ -z "$FORCE" ]]; then + echo "Kept $dest: it differs from $dir/$(basename "$src"). --force replaces it." >&2 + continue + fi + ln -sfn "$src" "$dest" + echo "Linked $dest" + done +done