-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path22.sh
486 lines (445 loc) · 16.8 KB
/
22.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
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
#!/bin/bash
#(awk '{ print $2 }' /var/log/installer/media-info )
rep=""
pakete=""
service="" #be careful not fully implemented now!
remove=""
# Add fastly repository
if ! grep fastly.linuxmint.io /etc/apt/sources.list.d/official-package-repositories.list
then
sudo sed -i '/^deb http:\/\/packages.linuxmint.com wilma main upstream import backport.*$/ideb http:\/\/fastly.linuxmint.io wilma main upstream import backport' /etc/apt/sources.list.d/official-package-repositories.list
fi
#Add other mirrors if timezone is Europe/Berlin
if grep Europe/Berlin /etc/timezone
then
if ! grep ftp-stud.hs-esslingen.de /etc/apt/sources.list.d/official-package-repositories.list
then
if ! grep -e ftp.uni-mainz.de -e ftp.rrzn.uni-hannover.de /etc/apt/sources.list.d/official-package-repositories.list
then
sudo sed -i '/^deb http:\/\/archive.ubuntu.com\/ubuntu noble main restricted universe multiverse$/ideb http:\/\/ftp.uni-mainz.de\/ubuntu noble main restricted universe multiverse\ndeb http:\/\/ftp.uni-mainz.de\/ubuntu noble-updates main restricted universe multiverse\ndeb http:\/\/ftp.uni-mainz.de\/ubuntu noble-backports main restricted universe multiverse\ndeb http:\/\/ftp-stud.hs-esslingen.de\/ubuntu noble main restricted universe multiverse\ndeb http:\/\/ftp-stud.hs-esslingen.de\/ubuntu noble-updates main restricted universe multiverse\ndeb http:\/\/ftp-stud.hs-esslingen.de\/ubuntu noble-backports main restricted universe multiverse\ndeb http:\/\/ftp.rrzn.uni-hannover.de\/pub\/mirror\/linux\/ubuntu noble main restricted universe multiverse\ndeb http:\/\/ftp.rrzn.uni-hannover.de\/pub\/mirror\/linux\/ubuntu noble-updates main restricted universe multiverse\ndeb http:\/\/ftp.rrzn.uni-hannover.de\/pub\/mirror\/linux\/ubuntu noble-backports main restricted universe multiverse' /etc/apt/sources.list.d/official-package-repositories.list
fi
if ! grep ftp.rz.uni-frankfurt.de /etc/apt/sources.list.d/official-package-repositories.list
then
sudo sed -i '/^deb http:\/\/packages.linuxmint.com wilma main upstream import backport.*$/ideb https:\/\/ftp-stud.hs-esslingen.de\/pub\/Mirrors\/packages.linuxmint.com wilma main upstream import backport\ndeb https:\/\/ftp.rz.uni-frankfurt.de\/pub\/mirrors\/linux-mint\/packages wilma main upstream import backport' /etc/apt/sources.list.d/official-package-repositories.list
fi
fi
fi
sudo apt-get update
sudo apt -y install nala
#sudo nala fetch
sudo nala full-upgrade -y
export DEBIAN_FRONTEND=noninteractive
if ! grep Wilma /etc/issue
then
read -p "Du benutzt kein Linux Mint der Version 22! Wenn du das Script trotzdem fortsetzen möchtest drücke j!"
echo # (optional) move to a new line
if [[ ! $REPLY =~ ^[Jj]$ ]]
then
exit 1
fi
fi
if [ $(uname -m) = x86_64 ]
then
Bit=64
elif [ $(uname -m) = i686 ]
then
Bit=32
else
echo "Konnte weder eine 32 Bit, noch eine 64 Bit Version vorfinden!"
echo "Breche ab!"
exit 1
fi
#https://forums.linuxmint.com/viewtopic.php?t=287026
sudo sed -i "/recordfail_broken=/{s/1/0/}" /etc/grub.d/00_header
sudo update-grub
#Config-Daten
verzeichnis=$(pwd)
config=$(pwd)/download
read -p "Soll das Programm KDE-Connect-Monitor (Zugriff von und aufs Handy) installiert werden? Dann drücke j!"
#echo # (optional) move to a new line
if [[ $REPLY =~ ^[Jj]$ ]]
then
pakete=`echo "$pakete kdeconnect"`
if [ -f "/usr/bin/cinnamon" ]
then
cinnamon_kdeconnect=true
fi
fi
if grep de_ <<< $LANG
then
string="Soll statt Evolution Thunderbird genutzt werden? Dann drücke j!"
else
string="Do you want to use Thunderbird instead of Evolution? Then press j!"
fi
read -p "$string"
if [[ ! $REPLY =~ ^[Jj]$ ]]
then
pakete=`echo "$pakete evolution"`
remove=`echo "$remove thunderbird*"`
sudo sed -i 's/^.*x-scheme-handler\/mailto=thunderbird.desktop.*$/x-scheme-handler\/mailto=org.gnome.Evolution.desktop/' $config/.config/mimeapps.list
sudo sed -i 's/^.*"thunderbird.desktop",.*$/"org.gnome.Evolution.desktop",/' $config/.config/cinnamon/spices/[email protected]/18.json
else
if grep "thunderbird" $config/.config/mimeapps.list
then
sudo sed -i 's/^.*x-scheme-handler\/mailto=thunderbird.desktop.*$/x-scheme-handler\/mailto=org.gnome.Evolution.desktop/' $config/.config/mimeapps.list
sudo sed -i 's/^.*"org.gnome.Evolution.desktop",.*$/"thunderbird.desktop",/' $config/.config/cinnamon/spices/[email protected]/18.json
fi
fi
if [ "$1" = "" ] || [ "$1" = "rep" ]
then
#Kopiere bei Bedarf Firefox, Chromium und gajim Einstellungen
alterUser=`who | awk '{ print $1 }'`
for i in $(ls /home); do
if [ $i != "lost+found" ]
then
sudo mkdir -p /home/$i/.config
sudo cp -rf $config/.config/mimeapps.list /home/$i/.config/
#dayon
sudo mkdir -p /home/$i/.dayon
sudo cp -rf $config/.dayon /home/$i
#hide Dayon Assistant and Matrix - Avoiding confusion with Dayon Assisted and Element Desktop
sudo mkdir -p /home/$i/.local/share/applications
sudo cp -f $config/.local/share/applications/* /home/$i/.local/share/applications/
#kdeconnect-cinnamon
if [ cinnamon_kdeconnect == true ]
then
if [ ! -d /home/$i/.config/cinnamon/spices/kdecapplet@joejoetv ]
then
sudo mkdir -p /home/$i/.config/cinnamon/spices/
sudo cp -rf $config/.config/cinnamon/spices/kdecapplet@joejoetv /home/$i/.config/cinnamon/spices/
fi
if [ ! -d /home/$i/.local/share/cinnamon/applets/kdecapplet@joejoetv ]
then
sudo mkdir -p /home/$i/.local/share/cinnamon/applets/
sudo cp -rf $config/.local/share/cinnamon/applets/kdecapplet@joejoetv /home/$i/.local/share/cinnamon/applets/
fi
fi
#nemo-actions
declare file=/home/$i/.config/nemo/actions-tree.json
if [ -f $file ]
then
read -p "Die Datei .config/nemo/actions-tree.json existiert schon, soll sie überschrieben werden? Dann drücke j!"
# echo # (optional) move to a new line
if [[ ! $REPLY =~ ^[Jj]$ ]]
then
echo "kopiere .config/nemo/actions-tree.json nicht"
else
overwriteNemo=true
sudo rm -f $file
fi
fi
if [ ! -d $dir ] || [ overwriteNemo == true ]
then
#echo $dir
sudo mkdir -p /home/$i/.config/nemo/
sudo cp -f $config/.config/nemo/actions-tree.json /home/$i/.config/nemo/
if ! grep de_ <<< $LANG
then
sed -i -e 's/Senden an/send to/g' /home/$i/.config/nemo/actions-tree.json
fi
fi
sudo cp -rf $config/.local/share/nemo/actions/* /home/$i/.local/share/nemo/actions/
#gajim
declare dir=/home/$i/.config/gajim
if [ -d $dir ]
then
read -p "Das Verzeichnis .config/gajim existiert schon, soll es überschrieben werden? Dann drücke j!"
# echo # (optional) move to a new line
if [[ ! $REPLY =~ ^[Jj]$ ]]
then
echo "kopiere gajim nicht"
else
overwriteGajim=true
sudo rm -rf /home/$i/.config/gajim
fi
fi
if [ ! -d $dir ] || [ overwriteGajim == true ]
then
#echo $dir
sudo mkdir -p /home/$i/.config
sudo cp -rf $config/.config/gajim /home/$i/.config
fi
#Google Chrome
declare dir=/home/$i/.config/google-chrome
if [ -d $dir ]
then
read -p "Das Verzeichnis .config/google-chrome existiert schon, soll es überschrieben werden? Dann drücke j!"
# echo # (optional) move to a new line
if [[ ! $REPLY =~ ^[Jj]$ ]]
then
echo "kopiere Google Chrome nicht"
else
overwriteChrome=true
sudo rm -rf /home/$i/.config/google-chrome
fi
fi
if [ ! -d $dir ] || [ overwriteChrome == true ]
then
#echo $dir
sudo mkdir -p /home/$i/.config
sudo cp -rf $config/.config/google-chrome /home/$i/.config
fi
#Vivaldi
declare dir=/home/$i/.config/vivaldi
if [ -d $dir ]
then
read -p "Das Verzeichnis .config/vivaldi existiert schon, soll es überschrieben werden? Dann drücke j!"
# echo # (optional) move to a new line
if [[ ! $REPLY =~ ^[Jj]$ ]]
then
echo "kopiere Vivaldi nicht"
else
overwriteChrome=true
sudo rm -rf /home/$i/.config/vivaldi
fi
fi
if [ ! -d $dir ] || [ overwriteChrome == true ]
then
#echo $dir
sudo mkdir -p /home/$i/.config
sudo cp -rf $config/.config/vivaldi /home/$i/.config
fi
#firefox
declare dir=/home/$i/.mozilla
if [ -d $dir ]
then
read -p "Das Verzeichnis Firefox existiert schon, soll es überschrieben werden? Dann drücke j!"
echo # (optional) move to a new line
if [[ ! $REPLY =~ ^[Jj]$ ]]
then
echo "kopiere Firefox nicht"
else
overwriteFirefox=true
sudo rm -rf /home/$i/.mozilla
fi
fi
if [ ! -d $dir ] || [ overwriteFirefox == true ]
then
#echo $dir
sudo cp -rf $config/.mozilla /home/$i/
fi
#autostart
sudo mkdir -p /home/$i/.config/autostart/
sudo cp -rf $config/.config/autostart/* /home/$i/.config/autostart/
#cinnamon download
if [ ! -d /home/$i/.local/share/cinnamon/applets/CinnVIIStarkMenu@NikoKrause ]
then
#echo $dir
sudo mkdir -p /home/$i/.local/share/cinnamon/applets/
sudo cp -rf $config/.local/share/cinnamon/applets/CinnVIIStarkMenu@NikoKrause /home/$i/.local/share/cinnamon/applets/
fi
if [ ! -d /home/$i/.local/share/cinnamon/extensions/cinnamon-maximus@fmete ]
then
#echo $dir
sudo mkdir -p /home/$i/.local/share/cinnamon/extensions/
sudo cp -rf $config/.local/share/cinnamon/extensions/cinnamon-maximus@fmete /home/$i/.local/share/cinnamon/extensions/
fi
sudo chown -R $i:$i /home/$i
fi
done
#cinnamon config
declare dir=~/.config/cinnamon/spices
if find ~/.config/ -name cinnamon -mtime +0
then
read -p "Das Verzeichnis .config/cinnamon/spices existiert schon, soll es überschrieben werden? Dann drücke j!"
# echo # (optional) move to a new line
if [[ ! $REPLY =~ ^[Jj]$ ]]
then
echo "kopiere .config/cinnamon/spices nicht"
else
overwriteCinnamon=true
rm -rf $dir
fi
fi
if find ~/.config/ -name cinnamon -mtime +0 || [ overwriteCinnamon == true ]
then
#echo $dir
mkdir -p $dir
cp -rf $config/.config/cinnamon/spices/* ~/.config/cinnamon/spices/
#dconf load /org/cinnamon/ < $config/dconf/cinnamon-stock.conf
dconf load /org/cinnamon/ < $config/dconf/cinnamon-ubuntumate.conf
dconf write /org/cinnamon/enabled-extensions "['cinnamon-maximus@fmete']"
fi
fi
#Nextcloud Desktop Client
if grep de_ <<< $LANG
then
string="Soll der Nextcloud Desktop Client installiert werden? Dann drücke j!"
else
string="Do you want to install the nextcloud desktop client? Then press j!"
fi
read -p "$string"
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Jj]$ ]]
then
pakete=`echo "$pakete nextcloud-desktop nemo-nextcloud"`
fi
#HP-lip gui
if grep de_ <<< $LANG
then
string="Möchtest du den Füllstand einens HP Druckers abnfragen können? Dann drücke j!"
else
string="Do you want to control the printer ink or toner levels of a HP printer? Then press j!"
fi
read -p "$string"
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Jj]$ ]]
then
pakete=`echo "$pakete hplip-gui"`
fi
#MangoHud
if grep de_ <<< $LANG
then
string="Möchtest du MangoHud installieren? Dann drücke j!"
else
string="Do you want install MangoHud? Then press j!"
fi
read -p "$string"
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Jj]$ ]]
then
pakete=`echo "$pakete mangohud"`
fi
#Gaming on AMD/Intel
read -p "Möchtest du Games spielen und hast eine AMD/Intel Grafikkarte? Dann drücke j!"
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Jj]$ ]]
then
sudo add-apt-repository -y ppa:kisak/kisak-mesa
pakete=`echo "$pakete mesa-vulkan-drivers mesa-vulkan-drivers:i386"`
fi
#Vivaldi (Chromium based Browser)
read -p "Soll Vivaldi (Chromium based Browser) installiert werden? Dann drücke j!"
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Jj]$ ]]
then
wget -qO- https://repo.vivaldi.com/archive/linux_signing_key.pub | gpg --dearmor | sudo dd of=/usr/share/keyrings/vivaldi-browser.gpg
echo "deb [signed-by=/usr/share/keyrings/vivaldi-browser.gpg arch=$(dpkg --print-architecture)] https://repo.vivaldi.com/archive/deb/ stable main" | sudo dd of=/etc/apt/sources.list.d/vivaldi-archive.list
pakete=`echo "$pakete vivaldi-stable"`
fi
#gajim
read -p "Do you want to install gajim? Then press y!"
#echo # (optional) move to a new line
if [[ $REPLY =~ ^[Jj]$ ]]
then
pakete=`echo "$pakete gajim-plugininstaller gajim-rostertweaks gajim-urlimagepreview gajim-omemo"`
read -p "Soll gajim für alle User automatisch gestartet werden? Dann drücke j!"
#echo # (optional) move to a new line
if [[ $REPLY =~ ^[Jj]$ ]]
then
sudo sh -c 'echo "[Desktop Entry]" > /etc/xdg/autostart/gajim.desktop'
sudo sh -c 'echo "Type=gajim" >> /etc/xdg/autostart/gajim.desktop'
sudo sh -c 'echo "Name=gajim" >> /etc/xdg/autostart/gajim.desktop'
sudo sh -c 'echo "Exec=gajim" >> /etc/xdg/autostart/gajim.desktop'
fi
fi
#flathub
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
#Fritz!Box
read -p "Soll das Programm Roger Router (ehemals ffgtk) für die Fritz!Box installiert werden? Dann drücke j!"
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Jj]$ ]]
then
sudo flatpak -y install flathub org.tabos.roger
fi
#Laptop Akkulaufzeit
read -p "Ist dies ein Laptop? Soll die Akkulaufzeit erhöht werden? Dann drücke j!"
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Jj]$ ]]
then
pakete=`echo "$pakete tlp tlp-rdw smartmontools ethtool"`
service=`echo "$service tlp.service"`
sudo flatpak -y install flathub com.github.d4nj1.tlpui
#TODO Find PPA for TLPUI - https://github.com/d4nj1/TLPUI
fi
#no 22.04 yet
#y-ppa-manager
#Entfernen
#pluma löschen, da ersatz ist konsole und kate
#read -p "Soll pluma gelöscht werden? Dann drücke j!"
#echo # (optional) move to a new line
#if [[ $REPLY =~ ^[Jj]$ ]]
#then
# remove=`echo "$remove pluma*"`
#fi
paketerec="digikam exiv2 kipi-plugins graphicsmagick-imagemagick-compat hw-probe"
pakete=`echo "$pakete synaptic krita krita-l10n ubuntu-restricted-extras pidgin nfs-common language-pack-kde-de libdvd-pkg smartmontools unoconv mediathekview python3-axolotl python3-gnupg language-pack-de fonts-symbola vlc libxvidcore4 libfaac0 gnupg2 lutris dayon kate konsole element-desktop redshift-gtk qpwgraph kasts meld pavucontrol"`
remove=`echo "$remove casper"`
#sudo snap remove firefox
sudo nala purge -y $remove
#Updaten
cd ~/Downloads/
sudo nala install -y wget apt-transport-https
sudo wget -O /usr/share/keyrings/element-io-archive-keyring.gpg https://packages.element.io/debian/element-io-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/element-io-archive-keyring.gpg] https://packages.element.io/debian/ default main" | sudo tee /etc/apt/sources.list.d/element-io.list
sudo add-apt-repository -y ppa:regal/dayon
#no 22.04 yet
#sudo add-apt-repository -y ppa:webupd8team/y-ppa-manager
#Aktiviert die Standard Ubuntu Quellen für Fremd-Software-Entwickler
#sudo add-apt-repository -y "deb http://archive.canonical.com/ubuntu $(lsb_release -sc) partner"
echo $rep > rep.log
IFS=" "
oIFS=$IFS
for i in $rep; do
sudo add-apt-repository -y $i
done
#fi
sudo nala full-upgrade -y
echo $paketerec > paketerec.log
sudo nala install -y --no-install-recommends $paketerec
echo $pakete > pakete.log
sudo nala install -y $pakete
#hide Dayon Assistant
sudo mv $config/usr/share/applications/dayon_assistant.desktop /usr/share/applications/
sudo update-alternatives --set x-terminal-emulator /usr/bin/konsole
dconf write /org/cinnamon/desktop/applications/terminal/exec "'konsole'"
dconf load /org/cinnamon/desktop/peripherals/touchpad/ < $config/dconf/touchpad.conf
dconf load /org/nemo/desktop/ < $config/dconf/desktop.conf
#<super>L = locking screen
dconf load /org/cinnamon/desktop/keybindings/ < $config/dconf/keybindings.conf
dconf write /org/cinnamon/desktop/wm/preferences/num-workspaces 2
dconf write /org/cinnamon/desktop/interface/gtk-theme "'Mint-Y-Dark-Aqua'"
sudo dpkg-reconfigure libdvd-pkg
#sudo snap install carnet
if [ ! -z $service ]
then
sudo systemctl enable $service
fi
sudo nala install --fix-broken -y
#Auto-Update
if grep "Linux Mint" /etc/issue
then
sudo mintupdate-automation upgrade enable
sudo mintupdate-automation blacklist enable
if ! grep "firefox" /etc/mintupdate.blacklist
then
sudo su -c 'echo "firefox" >> /etc/mintupdate.blacklist'
fi
sudo mintupdate-automation autoremove enable
#flatpack and cinnamon-spices autoupdates and Hiding linuxmint updates when not necessary
dconf load /com/linuxmint/updates/ < $config/dconf/linuxmint-updates.conf
else
sudo dpkg-reconfigure -plow unattended-upgrades
sudo cp -f $config/50unattended-upgrades /etc/apt/apt.conf.d/50unattended-upgrades
fi
sudo cp -f $config/firefoxUpdateOnShutdown.service /etc/systemd/system/firefoxUpdateOnShutdown.service
sudo systemctl daemon-reload
sudo systemctl enable firefoxUpdateOnShutdown.service
#Enable guest user
declare file=/etc/lightdm/lightdm.conf
if [ -f $file ]
then
if grep "allow-guest=" /etc/lightdm/lightdm.conf
then
sudo sed -i 's/^.*allow-guest=.*$/allow-guest=true/' /etc/lightdm/lightdm.conf
else
echo "/etc/lightdm/lightdm.conf exists but allow-guest not. To prevent messing up things I do nothing."
fi
else
sudo cp $config/etc/lightdm/lightdm.conf /etc/lightdm/
fi
#Hardware probe
sudo -E hw-probe -all -upload
sudo nala purge -y hw-probe
#Aufräumen
rm -rf $verzeichnis/Install-Skript