Update utils

This commit is contained in:
Kuba Orlik 2022-04-24 18:22:58 +02:00
parent faba231818
commit 9c329d78d8

View File

@ -26,10 +26,14 @@ click (){
xdotool click 1 xdotool click 1
} }
grab_no=0
grab (){ grab (){
NOTE="$@" NOTE="$grab_no $@"
echo $@ #echo $@
scrot --note "-f '/usr/share/fonts/noto/NotoSansMono-Medium.ttf/40' -c 255,0,0,255 -t '$NOTE'" ((grab_no++))
# scrot --note "-f '/usr/share/fonts/noto/NotoSansMono-Medium.ttf/40' -c 255,0,0,255 -t '$NOTE'"
#echo "not grabbing"
} }
keycombo(){ keycombo(){
@ -59,19 +63,26 @@ start_firefox(){
prepare_firefox(){ prepare_firefox(){
xdotool key Return # in case there's a "firefox closed unexpectedly" button xdotool key Return # in case there's a "firefox closed unexpectedly" button
sleep 1 sleep 1
grab "after sleep 1"
click 1886 13 #maximize button click 1886 13 #maximize button
grab "after maximize"
sleep 1 sleep 1
sleep 0.1 grab "after sleep 1"
keycombo Control_L Shift_L e keycombo Control_L Shift_L e
keycombo Shift_L c F5 #profiler grab "after ctrl+shift+e"
keycombo Shift_L F5 #profiler
grab "after shift-c F5"
keycombo Control_L Shift_L e keycombo Control_L Shift_L e
} }
load_website(){ load_website(){
URL=$1 URL=$1
keycombo Control_L l keycombo Control_L l
grab ctrl+l
xdotool type "$URL" xdotool type "$URL"
grab type url
xdotool key Return xdotool key Return
grab enter
sleep 1 sleep 1
echo "waiting for $URL to load..." echo "waiting for $URL to load..."
times=0 times=0
@ -79,29 +90,30 @@ load_website(){
do do
sleep 0.5 sleep 0.5
printf "." printf "."
#scrot scrot
times=$((times + 1)) times=$((times + 1))
if [ $times -eq 10 ] if [ $times -eq 60 ]
then then
echo "Could not load website in time" echo "Could not load website in time"
exit 1;
break; break;
fi fi
done done
echo "website loaded!"
} }
open_network_inspector(){ open_network_inspector(){
keycombo Shift_L F5 #profiler keycombo Shift_L F5 #profiler
echo shift f5
sleep 1 sleep 1
echo "sleep 1"
keycombo Control_L Shift_L e keycombo Control_L Shift_L e
echo ctrl shift e
} }
network_inspector_search(){ network_inspector_search(){
query=$1 query=$1
keycombo Control_L f keycombo Control_L f
sleep 0.2 sleep 0.2
keycombo Control_L a
sleep 0.1
xdotool type "$query" xdotool type "$query"
xdotool key Escape xdotool key Escape
sleep 0.3 sleep 0.3