-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup
executable file
·371 lines (349 loc) · 16.6 KB
/
setup
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
#!/bin/bash
# WeeChat configurator for Chads
H=${HOME}/.weechad
nick_conf=""
theme_conf=""
script_conf=""
server_conf=""
configure() {
nick_conf=${nick_conf:-"/print skip nick configuration"}
mkdir -p $H
err "configuring WeeChad"
setup-theme-conf
setup-script-conf
setup-server-conf
err "downloading some WeeChat plugins..."
pyscript autosort.py
pyscript grep.py
pyscript cmd_help.py
pyscript colorize_nicks.py
pyscript go.py
pyscript collapse_channel.py
pyscript queryman.py
plscript highmon.pl
printf "\n"
err "...done with plugins."
err "launching WeeChat for setup (you'll see the terminal blink)"
WEECHAT_HOME="$H" weechat -a -r "/quit"
WEECHAT_HOME="$H" weechat -a \
-r "$nick_conf" \
-r "$theme_conf" \
-r "$script_conf" \
-r "$server_conf" \
-r "/save" -r "/quit"
chmod -R go-rwx ~/.weechad
}
main() {
logo
if [ "$INSTALL" ]; then
err "Install function selected: $INSTALL"
install-something "$INSTALL" || {
err "Install error in: $INSTALL"
exit 1
}
exit 0
fi
############
# SETUP MAIN
[ -d $H/weechat.log ] && {
err "Cannot overwrite: $H"
err "If you are really sure, delete and run again."
exit 1
}
command -v weechat >/dev/null || {
err "WeeChat not installed."
exit 1
}
# TODO: better version checking
wcver=`weechat -v`
echo ${wcver} | grep 4.4.. >/dev/null || {
err "WeeChat installed is old: ${wcver}"
err "Install from: https://weechat.org/download/weechat/stable"
exit 1
}
setup-nick-conf
configure
err "Setup completed! Now copy ./weechad in your PATH"
err "at last I'm generating your startup script in ~/weechad"
cat <<EOF > ~/weechad
#!/bin/sh
if [ -r "\$HOME/weechad.tomb" -a -r "\$HOME/weechad.tomb.key" ]; then
tomb list weechad 2>dev/null ||
tomb open -f -k \$HOME/weechad.tomb.key \$HOME/weechad.tomb
WEECHAT_HOME=\$HOME/.weechad weechat -r '/server list'
tomb close weechad
else
WEECHAT_HOME=\$HOME/.weechad weechat -r '/server list'
fi
exit $?
EOF
chmod +x ~/weechad
err "Done! enjoy being a Chad 🗿"
err "Additional install modules available:"
err "INSTALL=tomb setup # encrypts all ~/.weechad data in a tomb"
err "INSTALL=darkirc setup # builds a local darkirc node for P2P IRC"
## END OF MAIN
##############
}
logo() {
cat <<EOF
⣦⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠹⣿⠛⠿⠷⣶⣦⣄⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⢿⣆⠀⠀⠀⠈⠉⠛⠿⢷⣶⣤⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠈⢿⡆⠀⠀⠀⠀⠀⠀⠀⠈⠉⠙⠿⢷⣦⣄⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠘⣿⡄⠀WeeChat⠀⠀⠀⠀⠉⠙⠛⢷⣦⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠸⣷⡀ setup ⠀⠀⠀⠉⠛⠿⣶⣤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⢽⣧⠀⠀ for Chads⠀⠀⠀⠀⠀⠀⠉⠛⠻⣦⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⢻⣇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠛⢷⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠈⢿⡆⠀⠀ ~/.weechad⠀ ⠀⠀⠀⠈⠙⠿⣤⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠘⣿⡄⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠻⣦⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠸⣧⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣠⣤⣤⣤⣶⠶⠶⠶⠶⢶⣦⣤⣌⣙⢳⣤⡀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⢿⣆⠀⠀⠀⠀⠀⠀⠀⠀⣀⣠⣤⣴⣶⠿⠟⠛⠛⠉⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠛⠻⢿⣧⣄⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠈⣿⡄⠀⣀⣤⣤⣶⡿⠛⠛⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣤⠀⠀⠀⠀⠈⠻⣷⡄⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⢹⠿⠛⠛⣿⡁⠀⠀⠀⠀⠀⢀⣀⣀⣀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣿⣦⠀⠀⠀⠀⠀⠘⢿⣦⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠹⣷⢠⣶⡾⠿⠛⠛⠛⠛⠋⠉⠛⠛⠓⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣿⠁⠀⠀⠀⠀⠀⠀⠀⠈⣿⣦⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⡌⢁⣠⣾⢞⣋⣂⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣴⡶⠿⠟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⣿⡀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⡿⢰⣾⡿⢿⡛⣿⣿⣿⢻⡿⢷⣦⣀⠀⠀⠀⠀⠀⠀⠀⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢿⣷⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⡿⠁⠈⠻⢷⣼⣷⣮⣽⣵⣿⣤⣶⠟⠁⠀⠀⠀⠀⠀⠀⠀⠈⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⠟⠀⠀⠀⠀⠈⠉⠉⠉⠉⠉⠉⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⣿⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⡾⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡀⠀⣠⣤⣶⣶⣦⣄⠀⠀⠀⠀⠀⠀⠀⢸⣿⠀
⠀⠀⠀⠀⠀⠀⠀⠀⣴⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⡟⠉⣿⣀⠈⢿⡆⠀⠀⠀⠀⠀⠀⣾⡿⠀
⠀⠀⠀⠀⠀⠀⢀⣼⡟⠐⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡆⠀⠀⢻⣷⡀⠏⢻⡆⢸⡇⠀⠀⠀⠀⠀⢀⣿⠃⠀
⠀⠀⠀⠀⠀⣴⡿⠋⠀⠀⠀⣠⣤⣤⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢾⣿⡆⠀⠀⠀⣶⣄⣾⡇⢸⡇⠀⠀⠀⠀⠀⣾⡟⠀⠀
⠀⠀⠀⠀⣼⡏⠀⠀⠀⠀⠘⠉⠙⠈⣿⣤⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⢻⣷⡂⠀⠀⣿⣛⣛⠁⣸⡇⠀⠀⠀⠀⣰⣿⡅⠀⠀
⠀⠀⠀⠀⠹⣷⣤⣀⣀⣀⣠⣤⣶⣶⠈⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠰⡙⣷⡄⠀⠀⠙⠿⡶⠿⠁⠀⠀⠀⢰⠟⣿⡇⠀⠀
⠀⠀⠀⠀⠀⠀⠉⠉⠉⠉⠉⢁⣾⠏⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⠹⣷⠀⠀⠀⠀⣀⠀⠀⠀⠀⣴⠏⠀⢻⣷⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⠟⠛⠲⠤⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣿⠀⠀⠀⠀⢻⡇⠀⠀⠀⠃⠀⠀⢸⣿⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⣾⡟⠁⠀⠀⠀⠀⠘⣻⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⠋⠀⠀⠀⠀⣿⣿⠀⠀⠀⠀⠀⠀⠀⣿⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠙⣿⣿⠛⠛⠛⠛⠛⠛⣽⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣤⠾⠛⠁⠀⠀⠀⠀⠀⣿⣿⠀⠀⠀⠀⠀⠀⠀⣿⡄⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⢻⣷⣀⠀⢀⣐⡧⠊⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡴⠋⠀⠀⠀⠀⠀⠀⠀⠀⢀⢿⣿⢀⠀⠀⠀⠀⠀⠀⣿⡇⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⢿⣏⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⡏⠀⠀⠀⠀⠀⠀⠀⢹⣇⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣤⡿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣤⣴⡿⠟⠋⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⠀
⠀⠀⠀⠀⠀⠀⢀⣴⠟⠛⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣤⣴⡾⠟⠛⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⣿⠀
⠀⠀⠀⠀⠀⠀⣼⡏⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣤⣴⣶⡿⠛⠛⠉⠀⠀⠀⠀⠀⠀⠀⣤⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⠀
⠀⠀⠀⠀⠀⠀⢿⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣴⠿⠛⠋⠉⢿⣧⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⠀
⠀⠀⠀⠀⠀⠀⠈⠙⠻⢷⣶⣤⣤⣀⣀⣀⣀⣠⣶⠿⠋⠀⠀⠀⠀⠀⠘⣿⣆⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⡀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠉⠉⠉⠉⠉⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠈⢿⣆⠀⠀⠀⠀⠀⠀⣠⣾⠟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣿⡇
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⣿⡆⠀⠀⢀⣴⡾⠛⠁⠀⣀⣀⠤⠖⠊⠉⠀⠀⠀⠀⠀⠉⠁
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣿⡇⠀⣰⣿⣏⣀⣤⠴⠖⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
EOF
}
err() { >&2 printf "🗿 $*\n"; }
setup-nick-conf() {
# running in terminal or through a pipe?
if [ -t 0 ]; then
if [ "$NICK" = "" ]; then
err "Chose a nickname?"
read nick
else
nick="$NICK"
fi
else
if [ "$NICK" = "" ]; then
err "Nickname undefined! Run setup locally or define your NICK:"
err "curl -Ls dyne.org/weechad/setup | NICK=yournick bash"
exit 1
else
nick="$NICK"
fi
fi
nick_conf="/set irc.server_default.nicks \"${nick},${nick}_,${nick}__,${nick}__\""
err "OK $nick! I'm generating your configuration in ~/.weechad"
}
setup-theme-conf() {
# THEME
while IFS= read -r line; do
[ "$line" = "" ] && continue
[ "${line:0:1}" = "#" ] && continue
theme_conf="$theme_conf;`printf '%s' "$line"`"
done <<EOF
# requires: 256 color terminal
/set weechat.startup.display_logo off
/set weechat.startup.display_version off
/set weechat.look.bar_more_down "▼"
/set weechat.look.bar_more_left "◀"
/set weechat.look.bar_more_right "▶"
/set weechat.look.bar_more_up "▲"
/set weechat.look.bare_display_time_format "%H:%M:%S"
/set weechat.look.buffer_time_format "[%H:%M:%S]"
/set weechat.look.item_buffer_filter "⚑"
/set weechat.look.item_time_format "%H:%M:%S"
/set weechat.look.buffer_notify_default message
/set weechat.look.color_nick_offline on
/set weechat.look.prefix_action " •"
/set weechat.look.prefix_error "×"
/set weechat.look.prefix_join "▬▶"
/set weechat.look.prefix_network "▬▬"
/set weechat.look.prefix_quit "◀▬"
/set weechat.look.prefix_same_nick "⤷"
/set weechat.look.prefix_suffix "│"
/set weechat.look.read_marker_always_show on
/set weechat.look.read_marker_string "─"
/set weechat.color.chat_highlight 7
/set weechat.color.chat_highlight_bg default
/set weechat.look.scroll_page_percent 50
/set weechat.color.chat_nick_colors "cyan,magenta,green,brown,lightblue,default,lightcyan,lightmagenta,lightgreen,blue,31,35,38,40,49,63,70,80,92,99,112,126,130,138,142,148,160,162,167,169,174,176,178,184,186,210,212,215,247"
/set weechat.color.chat_nick_self lightblue
/set weechat.color.chat_nick_offline darkgray
/set weechat.color.chat_prefix_join green
/set weechat.color.chat_prefix_network darkgray
/set weechat.color.status_count_msg green
/set weechat.color.status_name_ssl blue
/set irc.look.color_nicks_in_names on
/set irc.look.color_nicks_in_nicklist on
/set colorize_nicks.look.ignore_nicks_in_urls on
/set colorize_nicks.look.ignore_tags "irc_join,irc_part,irc_quit"
/set irc.look.color_nicks_in_names on
/set irc.look.color_nicks_in_server_messages off
/set irc.color.message_join darkgray
/set irc.color.message_quit darkgray
/set irc.color.reason_quit darkgray
/set colorize_nicks.look.colorize_input on
/trigger add url modifier weechat_print "${tg_tags} !~ irc_quit" ";[a-z]+://\S+;${color:228}${color:underline}${re:0}${color:reset};" ""
/trigger add nick modifier weechat_print "${tg_tags} =~ irc_nick" ";is now known as;${color:darkgray}is now known as;" ""
/trigger add disconnect modifier "weechat_print" "${tg_tags} !~ . && ${tg_buffer} !~ irc.server." ";irc: disconnected from server;${color:red}irc: disconnected from server;" ""
EOF
}
setup-script-conf() {
script_conf=""
while IFS= read -r line; do
[ "$line" = "" ] && continue
[ "${line:0:1}" = "#" ] && continue
script_conf="$script_conf;`printf '%s' "$line"`"
done <<EOF
/autosort helpers set monitors_buffers_first ${if:${buffer.full_name}!~^core\.(chan|high|news)mon$}
/autosort rules insert 3 ${monitors_buffers_first}
/set plugins.var.python.cmd_help.color_delimiters "*white"
/set plugins.var.python.cmd_help.color_arguments "121"
/set plugins.var.python.cmd_help.color_list "121"
/set plugins.var.python.cmd_help.start_on_load "on"
/set plugins.var.python.cmd_help.stop_on_enter "off"
/cmd_help
/highmon monitor
/bar add highmon root top auto 0 4
# /set weechat.bar.highmon.bar_lines 4
EOF
}
setup-server-conf() {
server_conf=""
while IFS= read -r line; do
[ "$line" = "" ] && continue
[ "${line:0:1}" = "#" ] && continue
server_conf="$server_conf;`printf '%s' "$line"`"
done <<EOF
# default servers
/server add darkirc localhost/6667 -notls
/server add 2f30 irc.2f30.org/6697 -tls
/server add anope irc.anope.org/6697 -tls
/server add blackcatz irc.blackcatz.org/6697 -tls
/server add blcknd irc.blcknd.net/6697 -tls
/server add buttes irc.buttes.org/6697 -tls
/server add efnet irc.servercentral.net/9999 -tls
/server add libera irc.libera.chat/6697 -tls
/server add gamesurge irc.gamesurge.net
/server add gangnet irc.gangnet.ru -tls
/server add hackint irc.hackint.org/6697 -tls
/server add irc irc.internetrelaychat.net/6697 -tls
/server add ircstorm irc.ircstorm.net/6699 -tls
/server add malvager irc.malvager.net/6697 -tls
/server add oftc irc.oftc.net/6697 -tls
/server add snoonet irc.snoonet.org/6697 -tls
/server add casalib irc.liberta.casa/6697 -tls
/server add sandnet irc.sandngz.net/6697 -tls
/server add silph irc.silph.co/6697 -tls
/server add supernets irc.supernets.org/6697 -tls
/server add tcpdirect ircd.chat/6697 -tls
/server add terahertz irc.terahertz.net/6697 -tls
/server add unreal irc.unrealircd.org/6697 -tls
/server add wigle wigle.net -tls
/server add wormnet wormnet1.team17.com
/server add wtfux irc.wtfux.org/6697 -tls
EOF
}
pyscript() {
printf " %s" "$1"
mkdir -p $H/python $H/python/autoload
curl -Ls https://weechat.org/files/scripts/${1} > $H/python/${1}
ln -sf $H/python/${1} $H/python/autoload/${1}
#scripts="$scripts;/script load ${1};/script autoload ${1}"
}
plscript() {
printf " %s" "$1"
mkdir -p $H/perl $H/perl/autoload
curl -Ls https://weechat.org/files/scripts/${1} > $H/perl/${1}
ln -sf $H/perl/${1} $H/perl/autoload/${1}
#scripts="$scripts;/script load ${1};/script autoload ${1}"
}
askpass() {
local p1
local p2
err "Set encryption password"
err "Chose the password to protect your WeeChad setup"
read -r -s -p "🗿 Type your password: " p1
>&2 printf "\n"
read -r -s -p "🗿 Type again to confirm: " p2
>&2 printf "\n"
[ "$p1" = "$p2" ] || {
p1="000000000000000000000000000000000"
p2="000000000000000000000000000000000"
err "Password mismatch, perhaps a typo?"
exit 1
}
printf "%s" "$p1"
p1="000000000000000000000000000000000"
p2="000000000000000000000000000000000"
return 0
}
install-something() {
case "$1" in
upgrade|update)
configure
;;
weechat)
;;
darkfi)
;;
tomb)
[ -d "$H" ] || {
err "Setup weechad first, then install it in a tomb."
exit 1; }
[ -r "$HOME/weechad.tomb" ] && {
err "Cannot overwrite existing tomb $HOME/weechat.tomb"
exit 1; }
[ -r "$HOME/weechad.tomb.key" ] && {
err "Cannot overwrite existing tomb key $HOME/weechat.tomb.key"
exit 1; }
local tombver=2.11
local tomb=""
while true; do # install tomb if missing
[ -x /usr/bin/tomb ] && { tomb="/usr/bin/tomb"; break; }
[ -x /usr/local/bin/tomb ] && { tomb="/usr/local/bin/tomb"; break; }
err "install Tomb from latest source"
ttmp=`mktemp`
curl -Ls https://files.dyne.org/tomb/Tomb-${tombver}.tar.gz \
> /tmp/"$ttmp".tar.gz
tar xf /tmp/"$ttmp".tar.gz -O "Tomb-${tombver}/tomb" > "$HOME/tomb"
tomb="$HOME/tomb"
break
done
set -e
local pp=`askpass`
$tomb dig -s 1024 $HOME/weechad.tomb
$tomb forge --ignore-swap --unsafe \
--tomb-pwd "$pp" -k $HOME/weechad.tomb.key
$tomb lock --ignore-swap --unsafe --filesystem btrfs \
--tomb-pwd "$pp" -k $HOME/weechad.tomb.key $HOME/weechad.tomb
$tomb open --ignore-swap --unsafe \
--tomb-pwd "$pp" -k $HOME/weechad.tomb.key $HOME/weechad.tomb
mv $H /media/weechad/weechad && mkdir -p $H
printf "weechad .weechad\n" > /media/weechad/bind-hooks
$tomb close weechad
set +e
err "Tomb setup complete! now you can:"
err "$tomb open -k \$HOME/weechad.tomb.key \$HOME/weechad.tomb"
err "To improve privacy remove the key from this machine!"
err "For more information see https://dyne.org/docs/tomb"
;;
esac
}
main