-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdebian-install.sh
executable file
·383 lines (343 loc) · 9.2 KB
/
debian-install.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
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
#!/bin/sh
# Verifica se é root
{
if [ $(id -nu) != 'root' ]; then
whiptail \
--title 'Usuario Errado' \
--msgbox "Voce esta executando o script com o usuario \"$(id -nu)\".\n\nExecute novamente utilizando o \"root\"." \
10 60 \
3>&1 1>&2 2>&3
exit 1
fi
}
# Pega usuário base
{
username=$(whiptail \
--title 'Nome de Usuario' \
--inputbox 'Digite o nome do seu usuario:' \
8 50 \
3>&1 1>&2 2>&3
)
status=$?
if [ $status != 0 ]; then
echo 'Erro ao obter username'
exit 1
fi
}
# Configurando os repositórios apt
{
cat > /etc/apt/sources.list << EOF
deb http://ftp.br.debian.org/debian/ testing main non-free contrib
# deb-src http://ftp.br.debian.org/debian/ testing main non-free contrib
deb http://ftp.br.debian.org/debian/ testing-updates main contrib non-free
# deb-src http://ftp.br.debian.org/debian/ testing-updates main contrib non-free
deb http://ftp.br.debian.org/debian/ stable main contrib non-free
# deb-src http://ftp.br.debian.org/debian/ stable main non-free contrib
deb http://ftp.br.debian.org/debian/ stable-updates main contrib non-free
# deb-src http://ftp.br.debian.org/debian/ stable-updates main non-free contrib
deb http://ftp.br.debian.org/debian/ unstable main contrib non-free
# deb-src http://ftp.br.debian.org/debian/ unstable main non-free contrib
deb http://ftp.br.debian.org/debian/ experimental main contrib non-free
# deb-src http://ftp.br.debian.org/debian/ experimental main non-free contrib
EOF
cat > /etc/apt/apt.conf << EOF
APT::Default-Release "testing";
EOF
cat > /etc/apt/preferences << EOF
Package: *
Pin: release a=testing
Pin-Priority: 500
Package: *
Pin: release a=stable
Pin-Priority: 150
Package: *
Pin: release a=unstable
Pin-Priority: 150
Package: *
Pin: release a=experimental
Pin-Priority: 50
EOF
apt update
apt full-upgrade -y
apt install -y --no-install-suggests \
linux-image-amd64 \
linux-headers-amd64
}
# Instala os pacotes básicos
{
apt install -y --no-install-suggests \
avahi-daemon \
rtkit \
rsync \
git \
curl \
wget \
bash-completion \
flatpak \
ntfs-3g \
p7zip-full \
p7zip-rar \
rar \
unrar-free \
zip \
unzip \
xdg-user-dirs \
xdg-utils \
sudo \
fuse3 \
sshfs \
nfs-common \
xdg-desktop-portal \
fonts-noto \
fonts-roboto \
fonts-open-sans \
fonts-firacode \
fonts-jetbrains-mono \
fonts-hack \
fonts-font-awesome \
fonts-fork-awesome \
fonts-dejavu \
mesa-utils \
network-manager \
network-manager-openvpn \
network-manager-openconnect \
firewalld \
plymouth \
plymouth-themes \
podman \
fuse-overlayfs \
slirp4netns \
crun \
uidmap \
wl-clipboard
if [ $(uname -m) = 'x86_64' ]; then
apt install -y --no-install-suggests \
thermald
fi
usermod -aG sudo $username
# Gera as pastas básicas na home
sudo -u $username sh -c 'cd $HOME && xdg-user-dirs-update'
# Habilita a ethernet no network manager
sed -i "s/managed=false/managed=true/g" /etc/NetworkManager/NetworkManager.conf
# Habilita o flathub
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
}
# Instala o áudio
{
audio=$(whiptail \
--title 'Audio' \
--radiolist 'Selecione o servidor de audio:' \
10 50 1 \
'pipewire' 'Pipewire + Wireplumbler' ON \
3>&1 1>&2 2>&3
)
status=$?
if [ $status != 0 ]; then
echo 'Erro ao obter audio'
exit 1
fi
if [ $audio = 'pipewire' ]; then
apt install -y --no-install-suggests \
pipewire \
pipewire-pulse \
wireplumber
# Habilita o pipewire
sudo -u $username systemctl --user daemon-reload
sudo -u $username systemctl --user enable --now \
wireplumbler.service \
pipewire.service \
pipewire-pulse.service
fi
}
# Instala a interface gráfica
{
interface=$(whiptail \
--title 'Interface Grafica' \
--radiolist 'Selecione o interface a ser instalada:' \
10 50 2 \
'sway' 'Sway WM' ON \
'gnome' 'Gnome Desktop' OFF \
3>&1 1>&2 2>&3
)
status=$?
if [ $status != 0 ]; then
echo 'Erro ao obter a interface'
exit 1
fi
if [ $interface = 'sway' ]; then
apt install -y --no-install-suggests --no-install-recommends \
sway \
swayidle \
swaylock \
sway-backgrounds \
xwayland \
xdg-desktop-portal-wlr \
yambar \
wofi \
mako-notifier \
notification-daemon \
libnotify-bin \
gdm3 \
nautilus \
gvfs-fuse \
keychain \
pulseaudio-utils \
brightnessctl \
playerctl \
wob
sudo -u $username bash -c "echo -e '/usr/bin/keychain \$HOME/.ssh/id_ed25519\nsource \$HOME/.keychain/\$HOSTNAME-sh' > \$HOME/.bashrc"
# keychain
elif [ $interface = 'gnome' ]; then
apt install -y --no-install-suggests \
xserver-xorg \
xserver-xorg-video-all \
xwayland \
xdg-user-dirs-gtk \
xdg-desktop-portal-gnome \
desktop-file-utils \
network-manager-gnome \
network-manager-openvpn-gnome \
network-manager-openconnect-gnome \
desktop-base \
power-profiles-daemon \
gnome-shell \
gnome-session \
gdm3 \
gnome-keyring \
libpam-gnome-keyring \
gnome-online-accounts \
gnome-control-center \
libcanberra-pulse \
gnome-themes-standard \
gnome-icon-theme \
gnome-backgrounds \
gnome-initial-setup \
gnome-disk-utility \
gnome-power-manager \
gnome-color-manager \
gnome-terminal \
nautilus \
nautilus-extension-gnome-terminal \
gnome-sushi \
file-roller \
gnome-maps \
gnome-font-viewer \
gnome-extensions-app \
gnome-clocks \
gnome-calendar \
gnome-calculator \
gnome-screenshot \
gnome-weather \
gnome-tweaks \
gnome-system-monitor \
evince \
celluloid \
eog \
gnome-shell-extension-desktop-icons-ng \
gnome-shell-extension-dashtodock \
gnome-shell-extension-sound-device-chooser \
gnome-shell-extension-appindicator \
libayatana-appindicator3-1 \
adwaita-qt \
adwaita-icon-theme
fi
}
# Instala o Bluetooth
{
bluetooth=$(whiptail \
--title 'Bluetooth' \
--yesno 'Instalar o bluetooth?' \
7 50 \
3>&1 1>&2 2>&3
)
status=$?
if [ $status = 0 ]; then
apt install -y --no-install-suggests --no-install-recommends \
bluetooth \
bluez-obexd \
bluez-tools
if [ $audio = 'pipewire' ]; then
apt install -y --no-install-suggests --no-install-recommends \
libspa-0.2-bluetooth
fi
if [ $interface = 'gnome' ]; then
apt install -y --no-install-suggests --no-install-recommends \
gnome-bluetooth
fi
fi
}
# Instala Utilitários Básicos
{
apt install -y --no-install-suggests --no-install-recommends \
foot
}
# Instala Utilitários
{
utilities=$(whiptail \
--title 'Utilitarios' \
--checklist 'Selecione os utilitarios a serem instalados:' \
14 74 7 \
'stone-notebook' 'Extras' OFF \
'firefox' 'Navegador Web Firefox' ON \
'firefox-flatpak' 'Navegador Web Firefox' OFF \
'google-chrome' 'Navegador Web Google Chrome' OFF \
'google-chrome-flatpak' 'Navegador Web Google Chrome' OFF \
'mpv' 'MPV Media Player' ON \
'celluloid-flatpak' 'Interface GTK para o MPV Media Player' OFF \
3>&1 1>&2 2>&3
)
for util in $utilities; do
util=$(echo $util | sed 's/"//g')
if [ $util = 'stone-notebook' ]; then
apt install -y --no-install-suggests \
intel-microcode \
iucode-tool \
firmware-iwlwifi \
mesa-vulkan-drivers \
mesa-va-drivers
if [ $interface = 'gnome' ]; then
apt install -y --no-install-suggests \
gnome-firmware
fi
fi
if [ $util = 'firefox' ]; then
apt install -y --no-install-suggests \
firefox-esr \
firefox-esr-l10n-pt-br
fi
if [ $util = 'firefox-flatpak' ]; then
flatpak install -y flathub org.mozilla.firefox
fi
if [ $util = 'google-chrome' ]; then
if [ $(uname -m) != 'x86_64' ]; then
whiptail \
--title 'CPU Invalido' \
--msgbox "Nao e possivel instalar o Google Chrome em cpus de arquitetura $(uname -m)" \
8 60 \
3>&1 1>&2 2>&3
fi
wget -O /tmp/google-chrome.deb 'https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb'
apt install /tmp/google-chrome.deb
rm /tmp/google-chrome.deb
fi
if [ $util = 'google-chrome-flatpak' ]; then
flatpak install -y flathub com.google.Chrome
fi
if [ $util = 'mpv' ]; then
apt install -y --no-install-suggests \
mpv
fi
if [ $util = 'celluloid' ]; then
flatpak install -y flathub io.github.celluloid_player.Celluloid
fi
done
}
# Finaliza a instalação
{
whiptail \
--title 'Instalacao Concluida' \
--msgbox 'Parabens!! A instalacao foi concluida com sucesso' \
8 60 \
3>&1 1>&2 2>&3
# systemctl reboot
}