diff options
Diffstat (limited to 'dot/local')
-rwxr-xr-x | dot/local/bin/xvnc | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/dot/local/bin/xvnc b/dot/local/bin/xvnc index 7c0159c..9378254 100755 --- a/dot/local/bin/xvnc +++ b/dot/local/bin/xvnc | |||
@@ -5,7 +5,7 @@ direct_connection() | |||
5 | port=$((5900 + local_display)) | 5 | port=$((5900 + local_display)) |
6 | ssh -o ControlPath=none -n \ | 6 | ssh -o ControlPath=none -n \ |
7 | -L $port:localhost:$port \ | 7 | -L $port:localhost:$port \ |
8 | ${remote_port+-p $remote_port} \ | 8 | ${remote_port:+-p $remote_port} \ |
9 | "$remote_host" \ | 9 | "$remote_host" \ |
10 | "x11vnc -nopw -ncache -ncache_cr -localhost -display ${remote_display}" & | 10 | "x11vnc -nopw -ncache -ncache_cr -localhost -display ${remote_display}" & |
11 | pid=$! | 11 | pid=$! |
@@ -26,7 +26,7 @@ reverse_connection() | |||
26 | pid=$! | 26 | pid=$! |
27 | quietly ssh -o ControlPath=none \ | 27 | quietly ssh -o ControlPath=none \ |
28 | -R $port:localhost:$port \ | 28 | -R $port:localhost:$port \ |
29 | ${remote_port+-p $remote_port} \ | 29 | ${remote_port:+-p $remote_port} \ |
30 | "$remote_host" \ | 30 | "$remote_host" \ |
31 | "x11vnc -q -nopw -localhost -display ${remote_display} -coe localhost:$port -rfbport 0" | 31 | "x11vnc -q -nopw -localhost -display ${remote_display} -coe localhost:$port -rfbport 0" |
32 | kill $pid | 32 | kill $pid |
@@ -41,7 +41,7 @@ share_display() | |||
41 | -o ExitOnForwardFailure=yes \ | 41 | -o ExitOnForwardFailure=yes \ |
42 | -f \ | 42 | -f \ |
43 | -L $port:localhost:$port \ | 43 | -L $port:localhost:$port \ |
44 | ${remote_port+-p $remote_port} \ | 44 | ${remote_port:+-p $remote_port} \ |
45 | "$remote_host" \ | 45 | "$remote_host" \ |
46 | "fuser -vk $port/tcp; DISPLAY=${remote_display} xvncviewer -fullscreen -encodings 'copyrect tight zrle hextile' -listen" | 46 | "fuser -vk $port/tcp; DISPLAY=${remote_display} xvncviewer -fullscreen -encodings 'copyrect tight zrle hextile' -listen" |
47 | trap "fuser -vk $port/tcp" INT | 47 | trap "fuser -vk $port/tcp" INT |
@@ -59,9 +59,13 @@ fi | |||
59 | 59 | ||
60 | remote_host=${1:-blackboard} | 60 | remote_host=${1:-blackboard} |
61 | 61 | ||
62 | remote_port=${remote_host##*:} | 62 | case "$remote_host" in |
63 | remote_host=${remote_host%:*} | 63 | *:*) remote_port=${remote_host##*:} |
64 | 64 | remote_host=${remote_host%:*} | |
65 | ;; | ||
66 | *) remote_port= | ||
67 | ;; | ||
68 | esac | ||
65 | remote_display=${2:-:0} | 69 | remote_display=${2:-:0} |
66 | local_display=${3:-:0} | 70 | local_display=${3:-:0} |
67 | 71 | ||