-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSetup-Void.sh
executable file
·293 lines (264 loc) · 7.38 KB
/
Setup-Void.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
#!/bin/bash
# Get the current username
username=$(whoami)
# Install base-devel, git, and other dependencies
sudo xbps-install -Syu git xtools
# Install xmirror utility
sudo xbps-install -Sy xmirror
# Use xmirror to select the fastest mirrors
# sudo xmirror -s https://repo-fastly.voidlinux.org/
sudo xmirror -s https://mirror.vofr.net/voidlinux/
# Install multilib and nonfree repos
sudo xbps-install -Sy void-repo-nonfree void-repo-multilib void-repo-multilib-nonfree
sudo xbps-install -Syu
# All packages (adapt package names as needed for Void Linux)
packages=(
# Void Builds Cinnamon packages
"dialog"
"cryptsetup"
"lvm2"
"mdadm"
"libxcrypt-compat"
"xorg-minimal"
"xorg-input-drivers"
"xorg-video-drivers"
#"intel-ucode"
"setxkbmap"
"xauth"
"font-misc-misc"
"alsa-plugins-pulseaudio"
"gptfdisk"
"gettext"
"elogind"
"dbus-elogind"
"dbus-elogind-x11"
"exfat-utils"
"fuse-exfat"
"wget"
"xdg-utils"
"xdg-desktop-portal"
"xdg-desktop-portal-gtk"
"xdg-desktop-portal-kde"
"xdg-user-dirs"
"xdg-user-dirs-gtk"
"AppStream"
"libvdpau-va-gl"
"vdpauinfo"
"pipewire"
"wireplumber"
"gstreamer1-pipewire"
"upower"
"dtrx"
"unzip"
"p7zip"
"bash-completion"
"colord"
"alsa-utils"
"pavucontrol"
"udisks2"
"ntfs-3g"
"gnome-keyring"
"network-manager-applet"
"adwaita-icon-theme"
"rsync"
"psmisc"
"dkms"
# System utilities
"file-roller"
"flatpak"
"gparted"
"grub-customizer"
"ncdu"
"neofetch"
"timeshift"
"unzip"
"xkill"
"xrandr"
# Network utilities
"filezilla"
"gvfs"
"gvfs-afc"
"gvfs-gphoto2"
"gvfs-mtp"
"gvfs-smb"
"kdeconnect"
"kf6-sonnet"
"samba"
# Desktop environment and related packages
"cinnamon"
"celluloid"
"eog"
"evince"
"ffmpegthumbnailer"
"gedit"
"gedit-plugins"
"gnome-calculator"
"gnome-screenshot"
"gnome-system-monitor"
"gnome-terminal"
"gthumb"
"gufw"
"kvantum"
"lightdm"
"lightdm-gtk-greeter-settings"
"lightdm-gtk3-greeter"
"nemo-fileroller"
"nemo-image-converter"
"nemo-preview"
#"nemo-share"
"qt5ct"
"qt6ct"
"rhythmbox"
# Applications
"bleachbit"
"bottom"
"GPaste"
"libreoffice"
"nano"
"neovim"
"octoxbps"
"qbittorrent"
# "rmlint"
"spice-vdagent"
"noto-fonts-ttf"
"noto-fonts-emoji"
"xclip"
# For NvChad
"gcc"
"make"
"ripgrep"
# Virtualization tools
"virt-manager"
"qemu"
"libvirt"
"edk2-ovmf"
"dnsmasq"
"vde2"
"bridge-utils"
"iptables"
"dmidecode"
"libguestfs"
)
# Update system and install packages
sudo xbps-install -Syu "${packages[@]}"
# Install Noto Fonts
# sudo rm -rf /usr/share/fonts/noto/
# sudo git clone --depth=1 https://github.com/SpreadiesInSpace/noto /usr/share/fonts/noto
# sudo rm -rf /usr/share/fonts/noto/.git
<<LANCZOS
# Apply ANTIALIAS to LANCZOS patch for cinnamon-settings backgrounds
# List of files to update
files=(
"/usr/share/cinnamon/cinnamon-settings-users/cinnamon-settings-users.py"
"/usr/share/cinnamon/cinnamon-settings/bin/imtools.py"
"/usr/share/cinnamon/cinnamon-settings/modules/cs_backgrounds.py"
"/usr/share/cinnamon/cinnamon-settings/modules/cs_user.py"
)
# Iterate over each file and replace 'ANTIALIAS' with 'LANCZOS'
for file in "${files[@]}"; do
if [ -f "$file" ]; then
sudo sed -i 's/ANTIALIAS/LANCZOS/g' "$file"
echo "Updated $file"
else
echo "File $file not found"
fi
done
echo "cinnamon-settings backgrounds LANCZOS patch complete!"
LANCZOS
# Install Brave
cd home/theming/Void
chmod +x update_brave.sh
./update_brave.sh
cd ..
# Enable Flathub
sudo flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
# Preserve old libvirtd configuration (for Virtual Machine Manager)
sudo cp /etc/libvirt/libvirtd.conf /etc/libvirt/libvirtd.conf.old
# Check for 'unix_sock_group' entry
if ! grep -q "^unix_sock_group = \"libvirt\"$" /etc/libvirt/libvirtd.conf; then
echo 'unix_sock_group = "libvirt"' | sudo tee -a /etc/libvirt/libvirtd.conf
else
sudo sed -i '/^#*unix_sock_group = "libvirt"/s/^#*//' /etc/libvirt/libvirtd.conf
fi
# Check for 'unix_sock_ro_perms' entry
if ! grep -q "^unix_sock_ro_perms = \"0777\"$" /etc/libvirt/libvirtd.conf; then
echo 'unix_sock_ro_perms = "0777"' | sudo tee -a /etc/libvirt/libvirtd.conf
else
sudo sed -i '/^#*unix_sock_ro_perms = "0777"/s/^#*//' /etc/libvirt/libvirtd.conf
fi
# Check for 'unix_sock_rw_perms' entry
if ! grep -q "^unix_sock_rw_perms = \"0770\"$" /etc/libvirt/libvirtd.conf; then
echo 'unix_sock_rw_perms = "0770"' | sudo tee -a /etc/libvirt/libvirtd.conf
else
sudo sed -i '/^#*unix_sock_rw_perms = "0770"/s/^#*//' /etc/libvirt/libvirtd.conf
fi
# Preserve old QEMU configuration (for Virtual Machine Manager)
sudo cp /etc/libvirt/qemu.conf /etc/libvirt/qemu.conf.old
# Check for 'user' entry
if ! grep -q "^user = \"$username\"$" /etc/libvirt/qemu.conf; then
echo "user = \"$username\"" | sudo tee -a /etc/libvirt/qemu.conf
fi
# Check for 'group' entry
if ! grep -q "^group = \"$username\"$" /etc/libvirt/qemu.conf; then
echo "group = \"$username\"" | sudo tee -a /etc/libvirt/qemu.conf
fi
# Check for 'swtpm_user' entry
if ! grep -q "^swtpm_user = \"$username\"$" /etc/libvirt/qemu.conf; then
echo "swtpm_user = \"$username\"" | sudo tee -a /etc/libvirt/qemu.conf
fi
# Check for 'swtpm_group' entry
if ! grep -q "^swtpm_group = \"$username\"$" /etc/libvirt/qemu.conf; then
echo "swtpm_group = \"$username\"" | sudo tee -a /etc/libvirt/qemu.conf
fi
# Enable and start services for Virt Manager
sudo ln -s /etc/sv/spice-vdagentd /var/service
sudo ln -s /etc/sv/libvirtd /var/service
sudo ln -s /etc/sv/virtlockd /var/service
sudo ln -s /etc/sv/virtlogd /var/service
# Enable and start services for LightDM & Cinnamon
sudo ln -s /etc/sv/dbus /var/service
sudo ln -s /etc/sv/lightdm /var/service
sudo ln -s /etc/sv/NetworkManager /var/service
sudo rm /var/service/dhcpcd
# Start and autostart the default network
sudo virsh net-start default
sudo virsh net-autostart default
# Add the current user to the necessary groups
groups=(libvirt libvirt-qemu kvm input disk video audio)
for group in "${groups[@]}"; do
sudo usermod -aG "$group" "$username"
done
# Backs up old lightdm.conf
sudo cp /etc/lightdm/lightdm.conf /etc/lightdm/lightdm.conf.old
# Replace specific lines in lightdm.conf
sudo awk -i inplace '
/^\[Seat:\*\]/ {a=1}
a==1 && /^#?greeter-hide-users=/ {
print "greeter-hide-users=false"
next
}
a==1 && /^#?display-setup-script=/ {
print "#display-setup-script=xrandr --output Virtual-1 --mode 1920x1080 --rate 60"
next
}
a==1 && /^#?autologin-user=/ {
print "#autologin-user='"$username"'"
next
}
a==1 && /^#?autologin-session=/ {
print "autologin-session=cinnamon"
next
}
{print}
' /etc/lightdm/lightdm.conf
# Create a new group named 'autologin' if it doesn't already exist
sudo groupadd -f autologin
# Add the current user to the 'autologin' group
sudo gpasswd -a $username autologin
# Run the setup script
# cd home/
# chmod +x Setup-Void-Theme.sh
# ./Setup-Void-Theme.sh
# cd ..
# Reboot for the changes to take effect
echo "Installation complete! Please reboot for the changes to take effect. Then run Setup-Void-Theme.sh in cinnamon/home for theming."