From 1c17243856cbbb76da7a31b0ef3031911658522f Mon Sep 17 00:00:00 2001 From: Kuba Orlik Date: Sat, 5 Mar 2022 21:21:05 +0100 Subject: [PATCH] Clean up the cli output of the script3 --- ephemeral-x.sh | 4 ++-- script3.sh | 32 ++++++++++++++++++++++++++------ 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/ephemeral-x.sh b/ephemeral-x.sh index 643909f..1df2f8e 100755 --- a/ephemeral-x.sh +++ b/ephemeral-x.sh @@ -118,7 +118,7 @@ while true; do set -- $XSERVER cmd=$1 shift - exec $cmd :$num "$@" + exec $cmd :$num "$@" > /dev/null 2>&1 ) & xpid=$! @@ -160,7 +160,7 @@ if [ ! -z "$WINMGR" -a "$WINMGR" != "none" ] ; then exec > /dev/null exec 2> /dev/null fi - $WINMGR + $WINMGR > /dev/null 2>&1 ) & winmgrpid=$! diff --git a/script3.sh b/script3.sh index f84585b..13d2d9c 100755 --- a/script3.sh +++ b/script3.sh @@ -59,13 +59,16 @@ annotate_header(){ height=1260 scrot $filename vips extract_area "$filename" "$cropped_filename" $left $top $width $height + echo "cropped image" } rm -rf /root/.mozilla/firefox/bifup8k5.docker/sessionstore-backups #echo 'user_pref("layout.css.devPixelsPerPx", "1.5");' >> /root/.mozilla/firefox/bifup8k5.docker/prefs.js -firefox --devtools & +firefox --devtools > /dev/null & + +# test FIREFOX_PID=$! @@ -95,6 +98,12 @@ xdotool key Escape sleep 0.1 grab after escape + +keycombo Control_L Shift_L e +xdotool key Escape +keycombo Shift_L c F5 #profiler +keycombo Control_L Shift_L e + grab after control shift e before ctrl L keycombo Control_L l @@ -111,19 +120,28 @@ sleep 1 scrot + echo "waiting for the website to load..." +times=0 while [ $(get_pixel_color 143 122) = "2E3436" ] # the center of the X icon that becomes a "refresh" icon once the website is finished loading do sleep 0.5 printf "." - grab loading + scrot + times=$((times + 1)) + if [ $times -eq 10 ] + then + echo "Could not load website in time" + break; + fi done -scrot - - -keycombo Control_L Shift_L c +keycombo Shift_L F5 #profiler +echo shift f5 +sleep 1 +echo "sleep 1" keycombo Control_L Shift_L e +echo ctrl shift e keycombo Control_L f sleep 0.2 xdotool type "method:GET domain:adocean.pl" # can filter with more granularity: https://developer.mozilla.org/en-US/docs/Tools/Network_Monitor/request_list#filtering_by_properties @@ -147,11 +165,13 @@ do xdotool key Down sleep 0.2 annotate_header set-cookie + # use python script ^here to annotate the cropped png # scrot # echo "########## EXTRACTED TEXT: " # extract_text 2056 330 824 1260 | grep cookie done +echo "Done!" kill -2 %%;