Clean up the cli output of the script3

This commit is contained in:
Kuba Orlik 2022-03-05 21:21:05 +01:00
parent c2680ddca5
commit 1c17243856
2 changed files with 28 additions and 8 deletions

View File

@ -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=$!

View File

@ -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 %%;