#!/usr/bin/env bash # Set up headless streaming mode: install prep-cmd hook scripts into a stable # location and ensure they're executable. The actual sunshine.conf entries # (capture=wlr, output_name=HEADLESS-1, global_prep_cmd=[...]) are written # by lib/config.sh. HEADLESS_BIN_DIR="$HOME/.local/share/omarchy-moonlight/bin" DO_SCRIPT="$HEADLESS_BIN_DIR/sunshine-stream-do.sh" UNDO_SCRIPT="$HEADLESS_BIN_DIR/sunshine-stream-undo.sh" export DO_SCRIPT UNDO_SCRIPT install_headless_hooks() { # Install hook scripts to ~/.local/share so they don't disappear if the # repo gets moved or deleted. Sunshine's config will reference these stable paths. mkdir -p "$HEADLESS_BIN_DIR" install -m 0755 "$SCRIPT_DIR/bin/sunshine-stream-do.sh" "$DO_SCRIPT" install -m 0755 "$SCRIPT_DIR/bin/sunshine-stream-undo.sh" "$UNDO_SCRIPT" ok "Installed prep-cmd hooks to $HEADLESS_BIN_DIR" }