summaryrefslogtreecommitdiff
path: root/dot/local/bin/xvnc
diff options
context:
space:
mode:
Diffstat (limited to 'dot/local/bin/xvnc')
-rwxr-xr-xdot/local/bin/xvnc10
1 files changed, 7 insertions, 3 deletions
diff --git a/dot/local/bin/xvnc b/dot/local/bin/xvnc
index 30e9218..957fa2b 100755
--- a/dot/local/bin/xvnc
+++ b/dot/local/bin/xvnc
@@ -8,7 +8,7 @@
8 8
9direct_connection() 9direct_connection()
10{ 10{
11 port=$((5900 + local_display)) 11 port=$((5900 + ${local_display#*:}))
12 ssh -o ControlPath=none -n \ 12 ssh -o ControlPath=none -n \
13 -L $port:localhost:$port \ 13 -L $port:localhost:$port \
14 ${remote_port:+-p $remote_port} \ 14 ${remote_port:+-p $remote_port} \
@@ -30,13 +30,13 @@ reverse_connection()
30 d=${DISPLAY%.*} 30 d=${DISPLAY%.*}
31 d=${d#:} 31 d=${d#:}
32 port=$((5500 + d)) 32 port=$((5500 + d))
33 xvncviewer -fullscreen -encodings "copyrect tight zrle hextile" -listen & 33 xvncviewer -v -fullscreen -encodings "copyrect tight zrle hextile" -listen &
34 pid=$! 34 pid=$!
35 quietly ssh -o ControlPath=none \ 35 quietly ssh -o ControlPath=none \
36 -R $port:localhost:$port \ 36 -R $port:localhost:$port \
37 ${remote_port:+-p $remote_port} \ 37 ${remote_port:+-p $remote_port} \
38 "$remote_host" \ 38 "$remote_host" \
39 "x11vnc -noxrecord -q -nopw -localhost -display ${remote_display} -coe localhost:$port -rfbport 0" 39 "set -x; x11vnc -noxrecord -q -nopw -localhost -display ${remote_display} -coe localhost:$port -rfbport 0 -v; echo \$?"
40 kill $pid 40 kill $pid
41} 41}
42 42
@@ -61,6 +61,10 @@ if [ "$1" = -r ]
61then 61then
62 shift 62 shift
63 cmd=share_display 63 cmd=share_display
64elif [ "$1" = -d ]
65then
66 shift
67 cmd=direct_connection
64else 68else
65 cmd=reverse_connection 69 cmd=reverse_connection
66fi 70fi