#!/bin/sh mode=$1 # open | view target=$2 # format: user@host case $mode in 'open') ssh -L 5901:localhost:5900 $target 'x11vnc -localhost -display :0' ;; 'view') vncviewer -encodings "copyrect tight hextile" localhost::5901 -compresslevel 7 -quality 5 ;; esac