-
Notifications
You must be signed in to change notification settings - Fork 4
/
debstrap.sh
executable file
·360 lines (330 loc) · 8.53 KB
/
debstrap.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
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
#!/bin/sh
#Bootstrapping script for Debian (Stable or Sid) systems.
set -e
#---------------------------------
#------ Debstrap Functions: ------
#---------------------------------
initialize() {
printf "Initializing bootstrap...\n"
printf " \n"
printf "Updating system...\n"
printf " \n"
sudo apt update
}
commons() {
printf "Installing commonly used packages...\n"
sudo apt install -y \
acpi-support \
bash-completion \
bookletimposer \
cups \
citation-style-language-locales \
citation-style-language-styles \
default-jdk \
deja-dup \
fd-find \
firmware-linux-nonfree \
firmware-misc-nonfree \
fonts-font-awesome \
foot \
fzf \
git \
gnome-power-manager \
gucharmap \
htop \
hunspell-es\
icc-profiles \
intel-microcode \
librecad \
libreoffice \
liblibreofficekitgtk \
libreoffice-java-common \
lm-sensors \
lollypop \
mupdf-tools \
neofetch \
neovim \
ocrmypdf \
opus-tools \
pandoc \
pandoc-citeproc \
pm-utils \
printer-driver-escpr \
python3-poppler-qt5 \
python3-pyqt5 \
silversearcher-ag \
sqlite3 \
texlive \
thermald \
tmux \
tree \
toilet \
unrar \
vim-gtk3 \
vlc
}
sidtools() {
printf "Installing Debian Sid related packages...\n"
sudo apt install -y \
apt-listbugs \
apt-listchanges \
apt-utils \
blender \
bombadillo \
create-resources \
foliate \
gimp \
gnome-text-editor \
gnome-console \
inkscape \
lf \
reportbug-gtk \
scribus \
swaylock \
swayimg \
wireplumber \
yt-dlp
sudo apt purge \
pipewire-media-session \
unattended-upgrades
}
swaytools() {
printf "Installing Sway related packages...\n"
sudo apt install -y \
brightnessctl \
evince \
gammastep \
grimshot \
mako-notifier \
ncal \
pavucontrol \
sway \
swayidle \
waybar \
wlogout \
wofi \
wf-recorder \
wtype \
xdg-desktop-portal-gtk \
xdg-desktop-portal-wlr \
xdg-user-dirs-gtk \
xdg-utils \
xwayland
}
gnome_setup_stable() {
printf "Installing Gnome components...\n"
sudo apt install -y \
gnome-core
printf "Setting up Gnome...\n"
sudo rm /etc/apt/sources.list
sudo cp $HOME/Debstrap/debian_stable.sources /etc/apt/sources.list.d/debian.sources
dconf load / < ~/Debstrap/full-desktop-backup
}
gnome_setup_sid() {
printf "Installing Gnome components...\n"
sudo apt install -y \
gnome-core
printf "Setting up Gnome...\n"
sudo rm /etc/apt/sources.list
sudo cp $HOME/Debstrap/debian_sid.sources /etc/apt/sources.list.d/debian.sources
dconf load / < ~/Debstrap/full-desktop-backup-sid
}
flathub() {
printf "Setting up flathub remote...\n"
printf " \n"
sudo apt install flatpak
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
}
bibliographical() {
printf "Installing academic related flatpaks\n"
printf " \n"
flatpak install flathub org.zotero.Zotero
flatpak install flathub com.github.johnfactotum.Foliate
}
flatapps() {
printf "Installing commonly used flatpaks...\n"
flatpak install flathub org.gimp.GIMP
flatpak install flathub org.inkscape.Inkscape
flatpak install flathub net.scribus.Scribus
flatpak install flathub org.kde.krita
flatpak install flathub org.blender.Blender
flatpak install flathub com.github.micahflee.torbrowser-launcher
flatpak install flathub com.github.tchx84.Flatseal
}
argodots() {
printf "Capturing dotfiles...\n"
printf " \n"
git clone git@github.com:argosatcore/Deb_Dots.git
printf " \n"
printf "Deploying dotfiles...\n"
printf " \n"
mv ~/Deb_Dots/.local/bin/ ~/.local/
mv ~/Deb_Dots/.local/share/fonts/ ~/.local/share/
mv ~/Deb_Dots/.local/share/nautilus/scripts/ ~/.local/share/nautilus/scripts/
mv -f ~/Deb_Dots/.config/* ~/.config/
mv ~/Deb_Dots/README.md ~/
mv ~/Deb_Dots/LICENSE ~/
mv ~/Deb_Dots/Debstrap/ ~/
mv ~/Deb_Dots/.git/ ~/
mv ~/Deb_Dots/.inputrc ~/
mv ~/Deb_Dots/.tmux.conf ~/
mv -f ~/Deb_Dots/.vimrc ~/
mv -f ~/Deb_Dots/.bash* ~/
mv -f ~/Deb_Dots/.profile ~/
mv -f ~/Deb_Dots/.vim/ ~/
rm -rf ~/Deb_Dots/
}
exodots() {
printf "May this dotfiles serve you well, fellow stranger...\n"
printf " \n"
git clone https://github.com/argosatcore/Deb_Dots.git
printf " \n"
printf "Deploying dotfiles...\n"
printf " \n"
mv ~/Deb_Dots/.local/bin/ ~/.local/
mv ~/Deb_Dots/.local/share/fonts/ ~/.local/share/
mv -f ~/Deb_Dots/.config/* ~/.config/
mv ~/Deb_Dots/README.md ~/
mv ~/Deb_Dots/LICENSE ~/
mv ~/Deb_Dots/Debstrap/ ~/
mv ~/Deb_Dots/.git/ ~/
mv ~/Deb_Dots/.inputrc ~/
mv ~/Deb_Dots/.tmux.conf ~/
mv -f ~/Deb_Dots/.vimrc ~/
mv -f ~/Deb_Dots/.bash* ~/
mv -f ~/Deb_Dots/.profile ~/
mv -f ~/Deb_Dots/.vim/ ~/
rm -rf ~/Deb_Dots/
}
sshkey() {
printf "Generating ssh key...\n"
ssh-keygen -t ed25519
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
printf "Add the SSH key to your github account\n"
cat ~/.ssh/id_ed25519.pub
printf "Press any key to continue\n"
read y
printf "Testing ssh connection"\n
ssh -T git@github.com
}
end() {
printf "Bootstrapping complete. Welcome back, Argos.\n"
}
remember() {
printf "Remember, those who forget their history are condemned to live it again, poorly.\n"
printf "Remember...\n"
printf "...\n"
nvim ~/Debstrap/project-history.en.txt
}
#-------------------------------
#------ Debstrap Options: ------
#-------------------------------
# 1---- Initialize script:
while true; do
read -p "Do you want to initialize this script?" yn
case $yn in
[Yy]* ) initialize; break;;
[Nn]* ) printf "Aborting script.\n"; exit;;
* ) printf "Please answer yes or no.\n";;
esac
done
# 2----- Installation of the commons:
while true; do
read -p "Do you want to install commons?" yn
case $yn in
[Yy]* ) commons; break;;
[Nn]* ) printf "Skipping commons installation.\n"; break;;
* ) printf "Please answer yes or no.\n";;
esac
done
# 3----- Installation of useful programs for Sid:
while true; do
read -p "Do you want to install sidtools?" yn
case $yn in
[Yy]* ) sidtools; break;;
[Nn]* ) printf "Skipping sidtools installation.\n"; break;;
* ) printf "Please answer yes or no.\n";;
esac
done
# 4----- Installation of useful Sway programs:
while true; do
read -p "Do you want to install swaytools?" yn
case $yn in
[Yy]* ) swaytools; break;;
[Nn]* ) printf "Skipping swaytools installation.\n"; break;;
* ) printf "Please answer yes or no.\n";;
esac
done
# 5----- Flathub set up:
while true; do
read -p "Do you want to set up flathub?" yn
case $yn in
[Yy]* ) flathub; break;;
[Nn]* ) printf "Skipping flathub set up.\n"; break;;
* ) printf "Please answer yes or no.\n";;
esac
done
# 6----- Installation of bibliographical programs:
while true; do
read -p "Do you want to install bibliographic programs?" yn
case $yn in
[Yy]* ) bibliographical; break;;
[Nn]* ) printf "Skipping bibliographical programs.\n"; break;;
* ) printf "Please answer yes or no.\n";;
esac
done
# 7----- Installation commonly used programs as flatpaks:
while true; do
read -p "Do you want to install commonly used programs as flatpaks?" yn
case $yn in
[Yy]* ) flatapps; break;;
[Nn]* ) printf "Skipping flatpak programs.\n"; break;;
* ) printf "Please answer yes or no.\n";;
esac
done
# 8----- Ssh key set up:
while true; do
read -p "Do you want set up your ssh key?" yn
case $yn in
[Yy]* ) sshkey; break;;
[Nn]* ) printf "Skipping ssh key set up.\n"; break;;
* ) printf "Please answer yes or no.\n";;
esac
done
# 9----- Dot files deployment:
while true; do
read -p "Are you Argos?" yn
case $yn in
[Yy]* ) argodots; break;;
[Nn]* ) exodots; break;;
* ) printf "Please answer yes or no.\n";;
esac
done
# 10---- Load Gnome configuration for Stable:
while true; do
read -p "Do you want to load Gnome configuration for Stable?" yn
case $yn in
[Yy]* ) gnome_setup_stable; break;;
[Nn]* ) printf "Skipping Gnome configuration for Stable.\n"; break;;
* ) printf "Please answer yes or no.\n";;
esac
done
# 11---- Load Gnome configuration for Sid:
while true; do
read -p "Do you want to load Gnome configuration for Sid?" yn
case $yn in
[Yy]* ) gnome_setup_sid; break;;
[Nn]* ) printf "Skipping Gnome configuration for Sid.\n"; break;;
* ) printf "Please answer yes or no.\n";;
esac
done
# 12---- Do you remember?
while true; do
read -p "Do you remember?" yn
case $yn in
[Yy]* ) end; exit;;
[Nn]* ) remember; exit;;
* ) printf "Please answer yes or no.\n";;
esac
done