Revision 65
- Date:
- 2008/02/06 23:59:09
- Files:
Legend:
- Added
- Removed
- Modified
-
trunk/webthumb
29 29 # It will create snapshot of following size 30 30 W=1024 31 31 H=768 32 D=24 32 33 33 34 # and then resize it to (comment out to disable) 34 35 #RESIZE=200x 35 36 36 37 # turn locally visible server to watch progress 37 38 DEBUG=0 38 test ! -z "$3" && DEBUG=1 39 if [ ! -z "$3" ] ; then 40 echo "DEBUG turned on" 41 DEBUG=1 42 D=8 43 fi 39 44 40 45 # wait for $WAIT seconds for page to load 41 46 WAIT=30 … … 93 98 94 99 if [ "$DEBUG" == 1 ] ; then 95 100 echo "using locally visible debug server on $LOCAL_DISPLAY" 96 DISPLAY=$LOCAL_DISPLAY Xephyr -ac -screen ${W}x${H}x24 $DISPLAY 2>/dev/null & 101 DISPLAY=$LOCAL_DISPLAY Xephyr -ac -screen ${W}x${H}x${D} $DISPLAY 2>/dev/null & 97 102 else 98 103 echo "starting $XSERVER" 99 $XSERVER -ac -screen 0 ${W}x${H}x24 $DISPLAY 2>/dev/null & 104 $XSERVER -ac -screen 0 ${W}x${H}x${D} $DISPLAY 2>/dev/null & 100 105 fi 101 106 102 107 if [ -z "$!" ] ; then … … 170 175 171 176 ping_browser 172 177 173 $BROWSER -remote "openURL($FRAMESET)" 2>/dev/null 174 175 echo "waiting for on_load event from browser $BROWSER_PID for ${WAIT}s" 176 177 # there is hard-coded limit here: 178 # we will wait $WAIT sec for page to load and render 179 180 echo -e "HTTP/1.0 304 Not modified\r\n\r\n" | nc -l -w $WAIT -p $PORT >/dev/null || echo "Timeout after $WAIT sec!" 181 182 178 # get Mozilla Firefox window id (for resize) 183 179 WINDOW_ID=`xwininfo -display $DISPLAY -root -tree | grep gecko | cut -d\" -f1 | sort -n | head -1` 184 180 … … 196 192 197 193 ping_browser 198 194 195 $BROWSER -remote "openURL($FRAMESET)" 2>/dev/null 196 197 echo "waiting for on_load event from browser $BROWSER_PID for ${WAIT}s" 198 199 # there is hard-coded limit here: 200 # we will wait $WAIT sec for page to load and render 201 202 echo -e "HTTP/1.0 304 Not modified\r\n\r\n" | nc -l -w $WAIT -p $PORT >/dev/null || echo "Timeout after $WAIT sec!" 203 199 204 # try to deduce inside area of window 200 205 201 206 DUMP_ID=`xwininfo -display $DISPLAY -id $WINDOW_ID -tree | grep 0x | grep -v ${W}x${H} | grep ${W}x | head -1 | sed 's/^ *//' | cut -d' ' -f1`