diff options
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" |
