#!/bin/bash # This controls what steps to run do_walk=1 do_smile=1 do_typing=1 CLICKAT=./clickat CMD="bash -c" function echo_jiffies() { $CMD bash << "EOF" xpid=`ps -C Xorg,Xtightvnc -o pid,args | grep ':3' | sed 's/^ *//' | cut -f 1 -d ' '`; jiffs=`cat /proc/$xpid/stat | cut -f 14,15,16,17 -d ' '`; echo Jiffies $jiffs EOF } wid=0 xoffset=0 yoffset=0 fname=master.ogv if [ $# -gt 0 ] ; then if [ "$1" == "spice display 0" ] ; then xoffset=0 yoffset=59 fname=spicegtk.ogv fi if [ "$1" == "TightVNC: jwhite's X desktop (spice1:3)" ] ; then xoffset=0 yoffset=0 fname=x11vnc.ogv fi if [ "$1" == "SPICEc:0" ] ; then xoffset=0 yoffset=0 fname=spicec.ogv fi if [ "$1" == "Spice Javascript client - Google Chrome" ] ; then xoffset=24 yoffset=122 fname=spicejs.ogv fi wid=`$CLICKAT find --timeout 1 --window "$1"` if [ $? -ne 0 ] ; then echo "Could not find window $1" exit 1 fi CLICKAT="$CLICKAT --wid $wid --noprint" if [ $# -gt 1 ] ; then CMD="ssh $2" fi fi $CMD /sbin/ifconfig > $fname.ifconfig date >> $fname.ifconfig echo_jiffies >> $fname.ifconfig recordmydesktop --windowid $wid -x $xoffset -y $((yoffset+4)) --width 800 --height 592 --no-sound --overwrite --full-shots --v_quality 0 --output $fname & record_pid=$! $CLICKAT restore echo Begin...hover over each of 8 choices if [ $do_walk -eq 1 ] ; then # Walk through the opening Libre Office screen, testing mouse position, and hover text $CLICKAT move --timed --timeout 500 --position $((225+xoffset))x$((245+yoffset)) $CLICKAT move --timed --timeout 500 --position $((225+xoffset))x$((295+yoffset)) $CLICKAT move --timed --timeout 500 --position $((225+xoffset))x$((345+yoffset)) $CLICKAT move --timed --timeout 500 --position $((225+xoffset))x$((420+yoffset)) $CLICKAT move --timed --timeout 500 --position $((525+xoffset))x$((245+yoffset)) $CLICKAT move --timed --timeout 500 --position $((525+xoffset))x$((295+yoffset)) $CLICKAT move --timed --timeout 500 --position $((525+xoffset))x$((345+yoffset)) $CLICKAT move --timed --timeout 500 --position $((525+xoffset))x$((420+yoffset)) echo Hover over the 3 lower choices $CLICKAT move --timed --timeout 1500 --position $((160+xoffset))x$((545+yoffset)) $CLICKAT move --timed --timeout 1500 --position $((190+xoffset))x$((545+yoffset)) $CLICKAT move --timed --timeout 1500 --position $((220+xoffset))x$((545+yoffset)) sleep 1 fi if [ $do_smile -eq 1 ] ; then # Open a drawing echo Opening a drawing, wait for it to be ready $CLICKAT key --keystroke '\a+r\a-' sleep 5 lo_button_y=560 # Draw a smile echo Draw a smile $CLICKAT click --timed --timeout 100 --position $((180+xoffset))x$((lo_button_y+yoffset)) #$CLICKAT click --timed --timeout 100 --position $((375+xoffset))x$((445+yoffset)) radius=100 centerx=520 centery=280 x=440 $CLICKAT click --timed --timeout 100 --position $((440+xoffset))x$((340+yoffset)) --noup while [ $x -le 600 ] ; do x=$((x+5)) if [ $x -ge $centerx ] ; then a=$((x-centerx)) fi if [ $x -lt $centerx ] ; then a=$((centerx - x)) fi b=`echo "sqrt(($radius*$radius)-($a*$a))" | bc` $CLICKAT move --position $((x+xoffset))x$((centery+b+yoffset)) ./msleep 10 done $CLICKAT click --position $((600+xoffset))x$((340+yoffset)) --nodown ./msleep 1000 $CLICKAT click --position $((124+xoffset))x$((lo_button_y+yoffset)) ./msleep 100 $CLICKAT click --delay 50 --position $((460+xoffset))x$((240+yoffset)) --dragto $((500+xoffset))x$((280+yoffset)) ./msleep 1000 $CLICKAT click --position $((124+xoffset))x$((lo_button_y+yoffset)) ./msleep 100 $CLICKAT click --delay 50 --position $((540+xoffset))x$((240+yoffset)) --dragto $((580+xoffset))x$((280+yoffset)) # Export our smile echo Export the smile $CMD rm -f /tmp/smile.png $CLICKAT click --timed --timeout 100 --position $((10+xoffset))x$((37+yoffset)) $CLICKAT key --delay-between-keystrokes 100 --keystroke 't\r' sleep 2 $CLICKAT key --keystroke '\a+n\a-' sleep 1 $CLICKAT key --delay-between-keystrokes 100 --keystroke '/tmp/smile\t' sleep 1 $CLICKAT key --delay-between-keystrokes 100 --keystroke 'pn\r' sleep 6 $CLICKAT key --delay-between-keystrokes 100 --keystroke '2\[Delete]' ./msleep 500 lo_compression_y=347 lo_compression_x=384 $CLICKAT click --delay 50 --noup --position $((lo_compression_x+xoffset))x$((lo_compression_y+yoffset)) --dragto $((lo_compression_x-120+xoffset))x$((lo_compression_y+yoffset)) ./msleep 2000 $CLICKAT click --delay 50 --nodown --dragto $((lo_compression_x+xoffset))x$((lo_compression_y+yoffset)) --position $((lo_compression_x-120+xoffset))x$((lo_compression_y+yoffset)) ./msleep 100 $CLICKAT click --timed --timeout 100 --position $((396+xoffset))x$((530+yoffset)) # Close the drawing echo Close the drawing $CLICKAT click --timed --timeout 100 --position $((10+xoffset))x$((37+yoffset)) $CLICKAT key --delay-between-keystrokes 100 --keystroke 'c' sleep 4 $CLICKAT key --delay-between-keystrokes 100 --keystroke 'd' fi if [ $do_typing -eq 1 ] ; then sleep 1 # Open a document echo Open a text document $CLICKAT key --keystroke '\a+d\a-' sleep 6 echo Type for a while # Type a paragraph at ~ 120 wps $CLICKAT key --delay-between-keystrokes 100 --keystroke "At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat." echo Insert the smile $CLICKAT click --timed --timeout 100 --position $((129+xoffset))x$((37+yoffset)) $CLICKAT click --timed --timeout 100 --position $((241+xoffset))x$((460+yoffset)) $CLICKAT click --timed --timeout 100 --position $((406+xoffset))x$((460+yoffset)) sleep 3 $CLICKAT key --delay-between-keystrokes 100 --keystroke "/tmp/smile.png\r" sleep 5 $CLICKAT key --delay-between-keystrokes 100 --keystroke "\e" sleep 4 echo Add more text # Add some more text $CLICKAT key --delay-between-keystrokes 100 --keystroke "\r" $CLICKAT key --delay-between-keystrokes 100 --keystroke "At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi" $CLICKAT key --delay-between-keystrokes 100 --keystroke "\r" $CLICKAT key --delay-between-keystrokes 100 --keystroke "At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi" $CLICKAT key --delay-between-keystrokes 100 --keystroke "\r" $CLICKAT key --delay-between-keystrokes 100 --keystroke "At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi" $CLICKAT key --delay-between-keystrokes 100 --keystroke "\r" $CLICKAT key --delay-between-keystrokes 100 --keystroke "At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi" $CLICKAT key --delay-between-keystrokes 100 --keystroke "\r" $CLICKAT key --delay-between-keystrokes 100 --keystroke "At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi" echo Scroll up and then back down # Scroll up and then back down $CLICKAT button4 --repeat 50 --timeout 2000 --timed --position $((400+xoffset))x$((300+yoffset)) $CLICKAT button5 --repeat 50 --timeout 2000 --timed --position $((400+xoffset))x$((300+yoffset)) echo Close the document # Close the document $CLICKAT click --timed --timeout 100 --position $((10+xoffset))x$((37+yoffset)) $CLICKAT key --delay-between-keystrokes 100 --keystroke 'c' sleep 4 $CLICKAT key --delay-between-keystrokes 100 --keystroke 'd' fi echo ... done $CMD /sbin/ifconfig >> $fname.ifconfig date >> $fname.ifconfig echo_jiffies >> $fname.ifconfig kill -s INT $record_pid