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