install.sh (1349B)
1 #!/usr/bin/env bash 2 # Valentine installer — builds the release binary and installs it on your PATH, 3 # plus the bundled themes. No driver, no admin, no daemon: it's a single 4 # userspace TUI. Re-run any time to update. 5 set -euo pipefail 6 7 cd "$(dirname "$0")" 8 9 BIN_DIR="${VALENTINE_BIN_DIR:-$HOME/.local/bin}" 10 THEME_DIR="$HOME/.config/valentine/themes" 11 12 echo "Valentine installer" 13 echo " binary → $BIN_DIR/valentine" 14 echo " themes → $THEME_DIR/" 15 echo 16 17 if ! command -v cargo >/dev/null 2>&1; then 18 echo "error: cargo (Rust) not found. Install from https://rustup.rs and re-run." >&2 19 exit 1 20 fi 21 22 echo "• building (release)…" 23 cargo build --release -p valentine 24 25 mkdir -p "$BIN_DIR" "$THEME_DIR" 26 install -m 0755 target/release/valentine "$BIN_DIR/valentine" 27 28 # Copy bundled themes so they're user-editable and appear in the picker. 29 # (The binary also has them compiled in; this just exposes them on disk.) 30 cp themes/*.toml "$THEME_DIR/" 2>/dev/null || true 31 32 echo 33 echo "✓ installed valentine → $BIN_DIR/valentine" 34 case ":$PATH:" in 35 *":$BIN_DIR:"*) echo " ($BIN_DIR is on your PATH — just run: valentine)" ;; 36 *) echo " NOTE: add $BIN_DIR to your PATH, e.g.:" 37 echo " echo 'export PATH=\"$BIN_DIR:\$PATH\"' >> ~/.zshrc" ;; 38 esac 39 echo 40 echo "Run it (quit Focusrite Control first): valentine" 41 echo "Uninstall: ./uninstall.sh"