diff options
Diffstat (limited to 'scripts/vnc.sh')
| -rwxr-xr-x | scripts/vnc.sh | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/scripts/vnc.sh b/scripts/vnc.sh new file mode 100755 index 0000000..ad9fefd --- /dev/null +++ b/scripts/vnc.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash + +set -eou + +cleanup() { + echo "Stopping VNC and i3..." + + kill -INT "$i3_pid" 2>/dev/null || true + kill -INT "$vnc_pid" 2>/dev/null || true + + wait "$i3_pid" 2>/dev/null || true + wait "$vnc_pid" 2>/dev/null || true +} + +trap cleanup INT TERM EXIT + +Xvnc :1 \ + -geometry 1920x1080 \ + -depth 24 \ + -rfbauth ~/.config/vnc/passwd & + +vnc_pid=$! + +sleep 1 + +DISPLAY=:1 \ +I3SOCK=/tmp/i3-vnc.sock \ +i3 -c ~/.config/i3/vnc & + +i3_pid=$! + +wait "$vnc_pid" "$i3_pid" |
