This repository has been archived by the owner on Nov 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.sh
369 lines (304 loc) · 13.4 KB
/
setup.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
#!/bin/bash
echo "This script will update your system."
echo "This script will install a large amount of software."
echo "This script will only remove a handful of applications."
echo "Please remove LinuxSetup folder once setup.sh has finished running."
#prompt
read -r -p "Are you sure you want to run this script? [y/N] " response
if [[ "$response" =~ ^([yY][eE][sS]|[yY])+$ ]]
then
read -r -p "Install Insync? [y/N] " response
if [[ "$response" =~ ^([yY][eE][sS]|[yY])+$ ]]
then
INSYNC="yes"
else
INSYNC="no"
fi
read -r -p "Install OpenRazer/Polychromatic? [y/N] " response
if [[ "$response" =~ ^([yY][eE][sS]|[yY])+$ ]]
then
OPENRAZER="yes"
else
OPENRAZER="no"
fi
read -r -p "Install CKB-next? [y/N] " response
if [[ "$response" =~ ^([yY][eE][sS]|[yY])+$ ]]
then
CKB="yes"
else
CKB="no"
fi
read -r -p "Install Android Studio and Flutter SDK? [y/N] " response
if [[ "$response" =~ ^([yY][eE][sS]|[yY])+$ ]]
then
ASTUDIO="yes"
else
ASTUDIO="no"
fi
read -r -p "Install Nvidia graphics driver? [y/N] " response
if [[ "$response" =~ ^([yY][eE][sS]|[yY])+$ ]]
then
NVIDIA="yes"
else
NVIDIA="no"
fi
#autosign
read -r -p "Auto-sign DKMS modules that are installed by this script? " autosign
echo "Starting script! Please do not stop this script once it has started."
#disable auto updates/upgrades check
systemctl disable --now apt-daily{,-upgrade}.{timer,service}
sudo killall dpkg
#enable 32-bit
sudo dpkg --add-architecture i386
#do updates and software upgrades
sudo apt-get update
sudo apt-get upgrade -y
#removals
sudo apt-get install tilix -y
sudo apt-get remove byobu gnome-terminal evince eog geary -y
sudo apt autoremove -y #clean up after removals
#installs
sudo apt-get install tilix asunder audacity deluge gnome-disk-utility gnome-system-monitor net-tools -y
sudo apt-get install gdebi inkscape libreoffice gcc make perl python3 psensor okular wireguard -y
sudo apt-get install vlc nomacs gnome-boxes thunderbird ^fonts-roboto- wine-stable p7zip-full traceroute -y
sudo apt-get install openjdk-11-jdk openjdk-11-jre neofetch curl cifs-utils lame -y
sudo apt-get install ffmpeg cups adb fastboot exfat-utils openssh-server blender avahi-discover ffmpegthumbnailer -y
sudo apt-get install easytag mosh nut system-config-printer gnome-calculator gnome-screenshot hunspell-en-ca fonts-noto-color-emoji -y
sudo apt-get install seahorse qemu-kvm apt-transport-https grub-customizer gimp gnome-tweaks software-properties-common -y
sudo apt-get install network-manager-openvpn-gnome network-manager-openconnect-gnome network-manager-l2tp-gnome network-manager-iodine-gnome -y
sudo usermod -a -G kvm $SUDO_USER
#new ppa/repo adds
sudo add-apt-repository ppa:nilarimogard/webupd8 -y #woeusb
sudo add-apt-repository ppa:unit193/encryption -y #veracrypt
sudo add-apt-repository ppa:papirus/papirus -y #papirus icons
sudo add-apt-repository ppa:tista/plata-theme -y #plata theme
sudo add-apt-repository ppa:andreasbutti/xournalpp-master -y #Xournal++
sudo add-apt-repository ppa:appimagelauncher-team/stable -y #AppImageLauncher
#Signal messenger
curl -s https://updates.signal.org/desktop/apt/keys.asc | sudo apt-key add -
echo "deb [arch=amd64] https://updates.signal.org/desktop/apt xenial main" | sudo tee -a /etc/apt/sources.list.d/signal.list
#VSCodium
wget -qO - https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg | sudo apt-key add -
echo 'deb https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/repos/debs/ vscodium main' | sudo tee -a /etc/apt/sources.list.d/vscodium.list
#update after repo adds
sudo apt-get update
#new ppa/repo installs
sudo apt-get install woeusb -y
sudo apt-get install papirus-icon-theme
sudo apt-get install codium -y
sudo apt-get install veracrypt -y
sudo apt-get install signal-desktop -y
sudo apt-get install plata-theme -y
sudo apt-get install xournalpp -y
sudo apt-get install appimagelauncher -y
signal takes some tweaking
echo '[Desktop Entry]
Name=Signal
Comment=Private messaging from your desktop
signal-desktop %U --start-in-tray
Terminal=false
Type=Application
Icon=signal-desktop
StartupWMClass=Signal
Categories=Network;' | sudo tee /usr/share/applications/signal-desktop.desktop
mkdir /home/$SUDO_USER/.config/autostart
sudo chown -R $SUDO_USER:$SUDO_USER /home/$SUDO_USER/.config
cp /usr/share/applications/signal-desktop.desktop /home/$SUDO_USER/.config/autostart/signal-desktop.desktop #enable signal autostart
#gdebi/wget installs
mkdir deb
#discord
wget --show-progress "https://discordapp.com/api/download?platform=linux&format=deb" -O ./deb/discord.deb
sudo gdebi ./deb/discord.deb -n
#android messages
wget --show-progress "https://github.com/chrisknepper/android-messages-desktop/releases/download/v3.1.0/android-messages-desktop_3.1.0_amd64.deb" -O ./deb/androidmessages.deb
sudo gdebi ./deb/androidmessages.deb -n
#Bitwarden
wget --show-progress "https://vault.bitwarden.com/download/?app=desktop&platform=linux" -O ./deb/bitwarden.appimage
chmod +x ./deb/bitwarden.appimage
sudo mkdir /opt/bitwarden
sudo cp ./deb/bitwarden.appimage /opt/bitwarden/bitwarden.appimage
#check if installs insync
if [ $INSYNC = "yes" ]; then
echo "Insync install selected. Installing."
wget --show-progress "https://d2t3ff60b2tol4.cloudfront.net/builds/insync_3.1.4.40797-bionic_amd64.deb" -O ./deb/insync.deb
sudo gdebi ./deb/insync.deb -n
sudo apt-get update
sudo apt-get install insync-nautilus -y
else
echo "Insync install not selected. Skipping..."
fi
#check if installs openrazer
if [ $OPENRAZER = "yes" ]; then
echo "OpenRazer install selected. Installing."
sudo add-apt-repository ppa:openrazer/stable -y
sudo add-apt-repository ppa:polychromatic/stable -y
sudo apt-get update
sudo apt install openrazer-meta -y
sudo apt install polychromatic -y
sudo gpasswd -a $SUDO_USER plugdev
sudo gpasswd -a $USER plugdev
else
echo "Openrazer/Polychromatic install not selected. Skipping..."
fi
if [ $CKB = "yes" ]; then
echo "CKB-next install selected. Installing."
sudo add-apt-repository ppa:tatokis/ckb-next -y
sudo apt install ckb-next -y
else
echo "CKB-next install not selected. Continuing..."
fi
#check if installs Android Studio and Flutter SDK
if [ $ASTUDIO = "yes" ]; then
sudo apt-add-repository ppa:maarten-fonville/android-studio -y #android studio
sudo apt-get install android-studio -y
#Flutter SDK
wget --show-progress "https://storage.googleapis.com/flutter_infra/releases/stable/linux/flutter_linux_v1.12.13+hotfix.9-stable.tar.xz" -O ./deb/fluttersdk.tar.xz
tar xf ./deb/fluttersdk.tar.xz
sudo cp -R ./flutter /opt
export PATH="$PATH:/opt/flutter/bin"
echo 'export PATH="$PATH":/opt/flutter/bin' >> ~/.bashrc
flutter precache
else
echo "Android Studio and Flutter SDK install not selected. Skipping..."
fi
if [ $NVIDIA = "yes" ]; then
echo "Nvidia graphics driver install selected. Installing."
sudo add-apt-repository ppa:graphics-drivers/ppa -y
sudo apt-get update
sudo apt nvidia-graphics-drivers-440 -y
else
echo "Nvidia graphics driver install not selected. Skipping..."
fi
#setup Hangouts and Google Keep
sudo cp -R ./DesktopFiles/* /usr/share/applications
sudo cp -R ./icons/* /usr/share/icons
sudo rm /usr/share/applications/android-messages-desktop.desktop
#install Roboto mono
sudo mkdir /usr/share/fonts/robotomono
sudo cp -R ./RobotoMono/* /usr/share/fonts/robotomono
#fix time
timedatectl set-local-rtc 1
#fix open in terminal for tilix
tilix &
killall tilix
gsettings set org.gnome.desktop.default-applications.terminal exec tilix
#wireshark install near the end cause graphical
sudo apt-get install wireshark -y
sudo dpkg-reconfigure wireshark-common
sudo usermod -a -G wireshark $SUDO_USER
#MS fonts
sudo apt-get install ttf-mscorefonts-installer -y
sudo fc-cache -f -v
#tilix fix
echo 'if [[ $TILIX_ID ]]; then' >> /home/$SUDO_USER/.bashrc
echo 'source /etc/profile.d/vte.sh' >> /home/$SUDO_USER/.bashrc
echo 'fi' >> /home/$SUDO_USER/.bashrc
ln -s /etc/profile.d/vte-2.91.sh /etc/profile.d/vte.sh
#neofetch at terminal start
echo 'neofetch' >> /home/$SUDO_USER/.bashrc
#purple background fix
sudo update-alternatives --install /usr/share/gnome-shell/gdm3-theme.gresource gdm3-theme.gresource /usr/share/gnome-shell/gnome-shell-theme.gresource 100
#Remove Ubuntu dock
sudo rm -R /usr/share/gnome-shell/extensions/desktop-icons@csoriano
sudo rm -R /usr/share/gnome-shell/extensions/[email protected]
rm -R /home/$SUDO_USER/.local/share/gnome-shell/extensions/desktop-icons@csoriano
rm -R /home/$SUDO_USER/.local/share/gnome-shell/extensions/[email protected]
#Install other Gnome extensions
sudo apt install bash curl dbus perl -y
wget -O gnome-shell-extension-installer "https://github.com/brunelli/gnome-shell-extension-installer/raw/master/gnome-shell-extension-installer"
chmod +x gnome-shell-extension-installer
sudo -u "$SUDO_USER" ./gnome-shell-extension-installer 307 3.36 #Dash to Dock
sudo -u "$SUDO_USER" ./gnome-shell-extension-installer 19 3.36 #User Themes
sudo -u "$SUDO_USER" ./gnome-shell-extension-installer 1218 3.36 #Printers
sudo -u "$SUDO_USER" ./gnome-shell-extension-installer 7 3.36 #Removable Drive
sudo -u "$SUDO_USER" ./gnome-shell-extension-installer 8 3.36 #Places
sudo apt install gnome-shell-extension-log-out-button gnome-shell-extension-weather gnome-shell-extension-prefs gnome-shell-extension-multi-monitors gnome-shell-extension-no-annoyance gnome-shell-extension-hide-activities gnome-shell-extension-gsconnect gnome-shell-extension-gsconnect-browsers gnome-shell-extension-appindicator gnome-shell-extension-caffeine -y
#testing this
sudo mv /home/$SUDO_USER/.local/share/gnome-shell/extentions/* /usr/share/gnome-shell/extensions/
sudo chmod 755 /usr/share/gnome-shell/extensions/*
if [[ "$autosign" =~ ^([yY][eE][sS]|[yY])+$ ]]
then
#ensure openssl is installed
sudo apt-get install openssl -y
#create keys
sudo openssl req -new -x509 -newkey rsa:2048 -keyout /root/MOK.priv -outform DER -out /root/MOK.der -nodes -days 36500 -subj "/CN=Descriptive common name/"
#sign modules
if [ $OPENRAZER = "yes" ]; then
sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 /root/MOK.priv /root/MOK.der $(modinfo -n razerkbd)
sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 /root/MOK.priv /root/MOK.der $(modinfo -n razermouse)
sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 /root/MOK.priv /root/MOK.der $(modinfo -n razermousemat)
sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 /root/MOK.priv /root/MOK.der $(modinfo -n razerkraken)
sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 /root/MOK.priv /root/MOK.der $(modinfo -n razermug)
sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 /root/MOK.priv /root/MOK.der $(modinfo -n razercore)
fi
if [ $NVIDIA = "yes" ]; then
sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 /root/MOK.priv /root/MOK.der $(modinfo -n nvidia)
sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 /root/MOK.priv /root/MOK.der $(modinfo -n nvidia-modeset)
sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 /root/MOK.priv /root/MOK.der $(modinfo -n nvidia-drm)
sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 /root/MOK.priv /root/MOK.der $(modinfo -n nvidia-uvm)
fi
#check modules are signed
if [ $OPENRAZER = "yes" ]; then
tail $(modinfo -n razerkbd) | grep "Module signature appended"
tail $(modinfo -n razermouse) | grep "Module signature appended"
tail $(modinfo -n razermousemat) | grep "Module signature appended"
tail $(modinfo -n razerkraken) | grep "Module signature appended"
tail $(modinfo -n razermug) | grep "Module signature appended"
tail $(modinfo -n razercore) | grep "Module signature appended"
fi
if [ $NVIDIA = "yes" ]; then
tail $(modinfo -n nvidia) | grep "Module signature appended"
tail $(modinfo -n nvidia-modeset) | grep "Module signature appended"
tail $(modinfo -n nvidia-drm) | grep "Module signature appended"
tail $(modinfo -n nvidia-uvm) | grep "Module signature appended"
fi
#enroll the key
sudo mokutil --import /root/MOK.der
#confirm key is enrolled
mokutil --test-key /root/MOK.der
#auto re-sign: create generic conf file
echo 'POST_BUILD=../../../../../../root/sign-kernel.sh' | sudo tee -a /etc/dkms/sign-kernel-objects.conf
echo '#!/bin/bash
cd ../$kernelver/$arch/module/
for kernel_object in *ko; do
echo "Signing kernel_object: $kernel_object"
/usr/src/linux-headers-$kernelver/scripts/sign-file sha256 /root/MOK.priv /root/MOK.der "$kernel_object";
mokutil --import /root/MOK.der
done' | sudo tee -a /root/sign-kernel.sh
sudo chmod +x /root/sign-kernel.sh
if [ $OPENRAZER = "yes" ]; then
sudo ln -s /etc/dkms/sign-kernel-objects.conf /etc/dkms/openrazer-driver.conf
fi
if [ $NVIDIA = "yes" ]; then
sudo ln -s /etc/dkms/sign-kernel-objects.conf /etc/dkms/nvidia.conf
fi
fi
#clean up
#Remove SNAPS!
sudo apt remove --purge snapd -y
#Disable pppd-dns service
sudo systemctl disable pppd-dns.service
# Re-add Gnome store, remove snap plugin
sudo apt install gnome-software -y
sudo apt remove gnome-software-plugin-snap -y
sudo apt remove --purge snapd -y
sudo apt-mark hold snap
#cleanup packages
sudo apt autoremove -y
if [[ "$autosign" =~ ^([yY][eE][sS]|[yY])+$ ]]
then
echo "See https://sourceware.org/systemtap/wiki/SecureBoot for enrolling MOK keys that were generated by this script."
fi
echo "Don't forget! Set your theme, set your icons, set your fonts!"
#prompt
read -r -p "COMPLETE! REBOOT NOW? [y/N] " rebootnow
if [[ "$rebootnow" =~ ^([yY][eE][sS]|[yY])+$ ]]
then
echo "Rebooting!"
sudo reboot
else
echo "Reboot not selected. Please ensure you reboot at a later time."
fi
else
echo "Ok, exiting..."
fi