Take remote-chromium.sh's host as an argument instead of an env var

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Tommy Rantti 2026-10-02 13:40:17 +03:00
parent b7ad3a9b8c
commit 9593b233aa
2 changed files with 13 additions and 5 deletions

View file

@ -4,13 +4,20 @@
# would swallow the new window), then launches it there with its window
# drawn here.
#
# Usage: remote-chromium.sh [--x11] (default: waypipe)
# Remote host: $REMOTE_HOST, default teemu-thinkpad-ubuntu
# Usage: remote-chromium.sh [--x11] [host]
# --x11 classic X11 forwarding instead of waypipe
# host ssh host to run Chromium on (default: teemu-thinkpad-ubuntu)
set -euo pipefail
HOST="${REMOTE_HOST:-teemu-thinkpad-ubuntu}"
MODE="waypipe"
[ "${1:-}" = "--x11" ] && MODE="x11"
HOST="teemu-thinkpad-ubuntu"
for arg in "$@"; do
case "$arg" in
--x11) MODE="x11" ;;
-*) echo "Unknown option: $arg"; exit 1 ;;
*) HOST="$arg" ;;
esac
done
if [ "$MODE" = "waypipe" ] && ! command -v waypipe >/dev/null 2>&1; then
echo "waypipe not installed here - run: sudo apt install waypipe (needed on both machines)"