diff options
| -rw-r--r-- | nixos/environment.nix | 1 | ||||
| -rwxr-xr-x | scripts/vnc-attach.sh | 21 |
2 files changed, 22 insertions, 0 deletions
diff --git a/nixos/environment.nix b/nixos/environment.nix index 69673f9..c8139d0 100644 --- a/nixos/environment.nix +++ b/nixos/environment.nix @@ -79,6 +79,7 @@ mitmproxy certmitm ventoy + x11vnc.out ]; programs.command-not-found.enable = false; programs.nix-index.enable = true; 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" |
