-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1.sh
237 lines (187 loc) · 6.55 KB
/
1.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
#!/bin/bash
# https://github.com/Piercing666
# Check if Script is Run as Root
if [[ $EUID -ne 0 ]]; then
echo "You must be a root user to run this script, please run sudo su then try again" 2>&1
exit 1
fi
username=$(id -u -n 1000)
builddir=$(pwd)
echo "Starting Script 1.sh"
sleep 2
# Checks for active network connection
if [[ -n "$(command -v nmcli)" && "$(nmcli -t -f STATE g)" != connected ]]; then
awk '{print}' <<< "Network connectivity is required to continue."
exit
fi
apt install nala -y
# Enables non-free repositories and adds them to the sources list.
sudo rm /etc/apt/sources.list
sudo touch /etc/apt/sources.list
sudo chmod +rwx /etc/apt/sources.list
sudo printf "deb https://deb.debian.org/debian/ stable main contrib non-free non-free-firmware
deb http://security.debian.org/debian-security stable-security/updates main contrib non-free non-free-firmware
deb https://deb.debian.org/debian/ stable-updates main contrib non-free non-free-firmware
deb-src https://deb.debian.org/debian/ stable-updates main contrib non-free non-free-firmware" | sudo tee -a /etc/apt/sources.list
sudo add-apt-repository ppa:graphics-drivers/ppa -y
# Update packages list and update system
echo "Updating with non-free drivers"
sleep 2
apt update
apt upgrade -y && echo "Upgrading"
wait
# Making dir
echo "Adding directories"
sleep 2
cd "$builddir" || exit
mkdir -p /home/"$username"/.fonts
mkdir -p /var/lib/usbmux/.config
echo "Install Essentials"
sleep 2
apt install wget gpg flatpak gnome-software-plugin-flatpak -y
flatpak remote-add flathub https://dl.flathub.org/repo/flathub.flatpakrepo
apt update && upgrade -y
wait
apt full-upgrade -y
wait
sudo apt install -f
wait
flatpak update
wait
apt install gnome-shell -y
apt install kitty -y
apt install gnome-terminal -y
apt install gnome-text-editor -y
apt install dconf* -y
apt install pipx -y
apt install gnome-tweaks -y
apt install gnome-shell-extension-manager -y
apt install papirus-icon-theme -y
wait
pipx install gnome-extensions-cli --system-site-packages
echo "Changing Graphical Login"
sleep 2
# Enable graphical login and change target from CLI to GUI
# First admend the .gdm3 to add Intall section
sudo rm /lib/systemd/system/gdm3.service && sudo touch /lib/systemd/system/gdm3.service && sudo chmod +rwx /lib/systemd/system/gdm3.service && sudo printf "[Unit]
Description=GNOME Display Manager
# replaces the getty
Conflicts=getty@tty1.service
After=getty@tty1.service
# replaces plymouth-quit since it quits plymouth on its own
Conflicts=plymouth-quit.service
After=plymouth-quit.service
# Needs all the dependencies of the services it's replacing
# pulled from getty@.service and plymouth-quit.service
# (except for plymouth-quit-wait.service since it waits until
# plymouth is quit, which we do)
After=rc-local.service plymouth-start.service systemd-user-sessions.service
# GDM takes responsibility for stopping plymouth, so if it fails
# for any reason, make sure plymouth still stops
OnFailure=plymouth-quit.service
[Service]
ExecStartPre=/usr/share/gdm/generate-config
ExecStart=/usr/sbin/gdm3
KillMode=mixed
Restart=always
RestartSec=1s
IgnoreSIGPIPE=no
BusName=org.gnome.DisplayManager
EnvironmentFile=-/etc/default/locale
ExecReload=/usr/share/gdm/generate-config
ExecReload=/bin/kill -SIGHUP $MAINPID
KeyringMode=shared
[Install]
WantedBy=multi-user.target" | sudo tee -a /lib/systemd/system/gdm3.service
# And then the .gdm to add Intall section
sudo rm /lib/systemd/system/gdm.service && sudo touch /lib/systemd/system/gdm.service && sudo chmod +rwx /lib/systemd/system/gdm.service && sudo printf "[Unit]
Description=GNOME Display Manager
# replaces the getty
Conflicts=getty@tty1.service
After=getty@tty1.service
# replaces plymouth-quit since it quits plymouth on its own
Conflicts=plymouth-quit.service
After=plymouth-quit.service
# Needs all the dependencies of the services it's replacing
# pulled from getty@.service and plymouth-quit.service
# (except for plymouth-quit-wait.service since it waits until
# plymouth is quit, which we do)
After=rc-local.service plymouth-start.service systemd-user-sessions.service
# GDM takes responsibility for stopping plymouth, so if it fails
# for any reason, make sure plymouth still stops
OnFailure=plymouth-quit.service
[Service]
ExecStartPre=/usr/share/gdm/generate-config
ExecStart=/usr/sbin/gdm3
KillMode=mixed
Restart=always
RestartSec=1s
IgnoreSIGPIPE=no
BusName=org.gnome.DisplayManager
EnvironmentFile=-/etc/default/locale
ExecReload=/usr/share/gdm/generate-config
ExecReload=/bin/kill -SIGHUP $MAINPID
KeyringMode=shared
[Install]
WantedBy=multi-user.target" | sudo tee -a /lib/systemd/system/gdm.service
echo "Hello Handsome"
sleep 2
# Edit Graphical Login Settings
sudo rm /etc/gdm3/greeter.dconf-defaults && sudo touch /etc/gdm3/greeter.dconf-defaults && sudo chmod +rwx /etc/gdm3/greeter.dconf-defaults && sudo printf "# These are the options for the greeter session that can be set
# through GSettings. Any GSettings setting that is used by the
# greeter session can be set here.
# Note that you must configure the path used by dconf to store the
# configuration, not the GSettings path.
# Theming options
# ===============
# - Change the GTK+ theme
[org/gnome/desktop/interface]
# gtk-theme='Adwaita'
# - Use another background
[org/gnome/desktop/background]
# picture-uri='file:///usr/share/themes/Adwaita/backgrounds/stripes.jpg'
# picture-options='zoom'
# - Or no background at all
[org/gnome/desktop/background]
# picture-options='none'
# primary-color='#000000'
# Login manager options
# =====================
[org/gnome/login-screen]
# logo='/usr/share/images/vendor-logos/logo-text-version-64.png'
# - Disable user list
# disable-user-list=true
# - Disable restart buttons
# disable-restart-buttons=true
# - Show a login welcome message
banner-message-enable=true
banner-message-text='Hello Handsome'
# Automatic suspend
# =================
[org/gnome/settings-daemon/plugins/power]
# - Time inactive in seconds before suspending with AC power
# 1200=20 minutes, 0=never
sleep-inactive-ac-timeout=0
# - What to do after sleep-inactive-ac-timeout
# 'blank', 'suspend', 'shutdown', 'hibernate', 'interactive' or 'nothing'
sleep-inactive-ac-type='suspend'
# - As above but when on battery
sleep-inactive-battery-timeout=1200
sleep-inactive-battery-type='suspend'
#" | sudo tee -a /etc/gdm3/greeter.dconf-defaults
# Finalizing graphical login
systemctl enable gdm
systemctl enable gdm3 --now
# Use nala
bash scripts/usenala
apt update && upgrade -y
wait
flatpak update -y
wait
apt full-upgrade -y
wait
apt install -f
dpkg --configure -a
echo "After reboot run 2.sh"
sleep 3 && echo "Rebooting"
reboot