diff options
author | Andrew Cady <d@jerkface.net> | 2022-02-24 18:29:37 -0500 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2022-02-24 18:29:37 -0500 |
commit | 20a8b880aff9582ad3ad2201be1b9de43d60f513 (patch) | |
tree | 29d1968c460b2f47c7189df10efbbed5e8925458 /dot/local | |
parent | 1175ca0d70c2e0e828869ea38414bb4454178689 (diff) |
xvnc: use unix socket instead of tcp, always (now requires xtigervncviewer)
Diffstat (limited to 'dot/local')
-rwxr-xr-x | dot/local/bin/xvnc | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/dot/local/bin/xvnc b/dot/local/bin/xvnc index 3265a38..2984aa7 100755 --- a/dot/local/bin/xvnc +++ b/dot/local/bin/xvnc | |||
@@ -15,21 +15,21 @@ ssh() | |||
15 | 15 | ||
16 | direct_connection() | 16 | direct_connection() |
17 | { | 17 | { |
18 | port=$((5900 + ${local_display#*:})) | 18 | rando=$(tr -dc A-Za-z0-9 < /dev/urandom | head -c15) && [ "$rando" ] |
19 | ssh -o ControlPath=none -n \ | 19 | remote_socket_file=/tmp/x11vnc.$rando.socket |
20 | -L $port:localhost:$port \ | 20 | local_socket_file=/tmp/xtigervncviewer.$rando.socket |
21 | ${remote_port:+-p $remote_port} \ | 21 | |
22 | ssh -n \ | ||
23 | -o ControlPath=none \ | ||
24 | -o ExitOnForwardFailure=yes \ | ||
25 | -L "$local_socket_file:$remote_socket_file" \ | ||
26 | ${remote_port:+-p "$remote_port"} \ | ||
22 | "$remote_host" \ | 27 | "$remote_host" \ |
23 | "x11vnc -noxrecord -nopw -ncache -ncache_cr -localhost -display ${remote_display}" & | 28 | "x11vnc -noxrecord -q -nopw -ncache -ncache_cr -display $local_display -unixsock $remote_socket_file -rfbport 0" & |
24 | pid=$! | 29 | X11VNC=$! |
25 | sleep 1 # surrender race | 30 | sleep 1 |
26 | if [ "$NOTIGER" ] | 31 | xtigervncviewer "$local_socket_file" |
27 | then | 32 | kill $X11VNC |
28 | xtightvncviewer -encodings "copyrect tight zrle hextile" localhost:0 | ||
29 | else | ||
30 | xtigervncviewer localhost:0 | ||
31 | fi | ||
32 | kill $pid | ||
33 | } | 33 | } |
34 | 34 | ||
35 | atexit() | 35 | atexit() |