diff options
| author | Aargh Rai <aargh.rai+git@gmail.com> | 2026-08-12 01:05:51 +0530 |
|---|---|---|
| committer | Aargh Rai <aargh.rai+git@gmail.com> | 2026-08-12 01:05:51 +0530 |
| commit | 1cb4e47ccadfe3c673d46808838eca751001609e (patch) | |
| tree | fa328c048a0f0e4ae9b22e14a7a87f3923f1c4b0 /scripts/vnc-attach.sh | |
| parent | 855fc2707afba776b4e62e87eb45f76354c1ac23 (diff) | |
vnc attach to exiting session
Diffstat (limited to 'scripts/vnc-attach.sh')
| -rwxr-xr-x | scripts/vnc-attach.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/scripts/vnc-attach.sh b/scripts/vnc-attach.sh new file mode 100755 index 0000000..6b07e94 --- /dev/null +++ b/scripts/vnc-attach.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -euo pipefail + +DISPLAY=:0 +VNC_PASS="$HOME/.config/vnc/passwd" + +cleanup() { + echo "Stopping VNC..." + kill -INT "$vnc_pid" 2>/dev/null || true + wait "$vnc_pid" 2>/dev/null || true +} + +trap cleanup INT TERM EXIT + +x11vnc -display :0 -auth /run/user/1000/lyxauth -noshm -noxdamage -nowf -scale 1366x768 -rfbauth "$HOME/.config/vnc/passwd" -forever -shared + + +vnc_pid=$! + +wait "$vnc_pid" |
