-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpowers.sh
executable file
·169 lines (153 loc) · 5.39 KB
/
powers.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
#!/bin/bash
sudo apt install xdotool
sudo apt install xmlstarlet
CURRENT_WID=$(xdotool getwindowfocus)
echo "Detecting username..."
#if [ -f /etc/floflis-release ]
# then
# flouser=$(jq -r '.name' /1/config/user.json)
# else
flouser=$(logname)
#fi
cd /home/$flouser/.mozilla/firefox
for D in `find . -mindepth 1 -maxdepth 1 -type d`
do
if printf -- '%s' "${D}" | egrep -q -- ".default-default"
then
pure=$(echo "${D}" | sed -E 's|^\.{1,2}/||')
profilefolder="$pure"
fi
done
detecttab () {
if [[ "$(xdotool search --name "Welcome to Firedoge")" = "" ]];then (firedoge -new-tab -url file:///usr/lib/floflis/browser/firedoge/defaults/firstpage/index.html &) fi
}
until [ "$(xdotool search --name "Welcome to Firedoge")" ]
do
echo "Waiting for Firedoge 🐶 to wake up..."
sleep 3s
detecttab
done;WID=""$(xdotool search --name "Welcome to Firedoge")""
echo "Detecting doge 🐶 powers..."
until [ -f /home/"$flouser"/.mozilla/firefox/"${profilefolder}"/extensions/{cd7623f4-730d-4f6a-9f6c-6679b44cd906}.xpi ]
do
echo "DEBUG | FLOUSER: $flouser"
echo "DEBUG | PROFILE FOLDER: ${profilefolder}"
echo "Waiting to find Start Page installed..."
sleep 15s
xdotool windowactivate $CURRENT_WID
sleep 5s
xdotool windowactivate $WID
detecttab
done
contents="$(mlq '#startpage = ""' /usr/lib/floflis/browser/firedoge/defaults/firstpage/index.html)" && \
echo "${contents}" > /usr/lib/floflis/browser/firedoge/defaults/firstpage/index.html
xdotool windowactivate $WID
detecttab
xdotool key F5
echo "Start Page has been installed!"
until [ -f /home/"$flouser"/.mozilla/firefox/"${profilefolder}"/extensions/[email protected] ]
do
echo "DEBUG | FLOUSER: $flouser"
echo "DEBUG | PROFILE FOLDER: ${profilefolder}"
echo "Waiting to find PanoramaTabGroups installed..."
sleep 15s
xdotool windowactivate $CURRENT_WID
sleep 5s
xdotool windowactivate $WID
detecttab
done
contents="$(mlq '#panorama-tab-groups = ""' /usr/lib/floflis/browser/firedoge/defaults/firstpage/index.html)" && \
echo "${contents}" > /usr/lib/floflis/browser/firedoge/defaults/firstpage/index.html
xdotool windowactivate $WID
detecttab
xdotool key F5
echo "PanoramaTabGroups has been installed!"
until [ -f /home/"$flouser"/.mozilla/firefox/"${profilefolder}"/extensions/@vivaldi-fox.xpi ]
do
echo "DEBUG | FLOUSER: $flouser"
echo "DEBUG | PROFILE FOLDER: ${profilefolder}"
echo "Waiting to find VivaldiFox installed..."
sleep 15s
xdotool windowactivate $CURRENT_WID
sleep 5s
xdotool windowactivate $WID
detecttab
done
contents="$(mlq '#vivaldi-fox = ""' /usr/lib/floflis/browser/firedoge/defaults/firstpage/index.html)" && \
echo "${contents}" > /usr/lib/floflis/browser/firedoge/defaults/firstpage/index.html
xdotool windowactivate $WID
detecttab
xdotool key F5
echo "VivaldiFox has been installed!"
until [ -f /home/"$flouser"/.mozilla/firefox/"${profilefolder}"/extensions/[email protected] ]
do
echo "DEBUG | FLOUSER: $flouser"
echo "DEBUG | PROFILE FOLDER: ${profilefolder}"
echo "Waiting to find uBlock installed..."
sleep 15s
xdotool windowactivate $CURRENT_WID
sleep 5s
xdotool windowactivate $WID
detecttab
done
contents="$(mlq '#ublock = ""' /usr/lib/floflis/browser/firedoge/defaults/firstpage/index.html)" && \
echo "${contents}" > /usr/lib/floflis/browser/firedoge/defaults/firstpage/index.html
xdotool windowactivate $WID
detecttab
xdotool key F5
echo "uBlock has been installed!"
#until [ -f /home/"$flouser"/.mozilla/firefox/"${profilefolder}"/extensions/{e4db92bc-3213-493d-bd9e-5ff2afc72da6}.xpi ]
#do
# echo "Waiting to find SingleFileZ installed..."
# sleep 15s
# xdotool windowactivate $CURRENT_WID
# sleep 5s
# xdotool windowactivate $WID
# detecttab
#done
#contents="$(mlq '#singlefilez = ""' /usr/lib/floflis/browser/firedoge/defaults/firstpage/index.html)" && \
#echo "${contents}" > /usr/lib/floflis/browser/firedoge/defaults/firstpage/index.html
#xdotool windowactivate $WID
#detecttab
#xdotool key F5
#echo "SingleFileZ has been installed!"
until [ -f /home/"$flouser"/.mozilla/firefox/"${profilefolder}"/extensions/{77691beb-4c53-48de-ab20-6589a537717a}.xpi ]
do
echo "DEBUG | FLOUSER: $flouser"
echo "DEBUG | PROFILE FOLDER: ${profilefolder}"
echo "Waiting to find Frame installed..."
sleep 15s
xdotool windowactivate $CURRENT_WID
sleep 5s
xdotool windowactivate $WID
detecttab
done
contents="$(mlq '#frame = ""' /usr/lib/floflis/browser/firedoge/defaults/firstpage/index.html)" && \
echo "${contents}" > /usr/lib/floflis/browser/firedoge/defaults/firstpage/index.html
xdotool windowactivate $WID
detecttab
xdotool key F5
echo "Frame has been installed!"
until [ -f /home/"$flouser"/.mozilla/firefox/"${profilefolder}"/extensions/[email protected] ]
do
echo "DEBUG | FLOUSER: $flouser"
echo "DEBUG | PROFILE FOLDER: ${profilefolder}"
echo "Waiting to find IPFS installed..."
sleep 15s
xdotool windowactivate $CURRENT_WID
sleep 5s
xdotool windowactivate $WID
detecttab
done
contents="$(mlq '#ipfscompanion = ""' /usr/lib/floflis/browser/firedoge/defaults/firstpage/index.html)" && \
echo "${contents}" > /usr/lib/floflis/browser/firedoge/defaults/firstpage/index.html
#xdotool key Ctrl+w
#xdotool key F5
echo "IPFS has been installed!"
xdotool windowactivate $CURRENT_WID
#xdotool windowactivate $WID;xdotool key Ctrl+w
#sudo apt remove xdotool
pkill -f xdotool
pkill -f firedoge
exit 0
#echo "(✓) Done!";exit 0