auto


Logs | Files | README | LICENSE | GitLab


1
commit 8e74489380334fc652bbc97609f053c902aeeb73
2
Author: Connor Etherington <[email protected]>
3
Date:   Sat Mar 26 02:39:36 2022 +0200
4
5
    Update.
6
---
7
 Auto-PreInstall.sh | 140 +++++++++++++++++
8
 AutoInstall.sh     | 444 +++++++++++++++++++++++++++++++++++++++++++++++++++++
9
 LICENSE            |  29 ++++
10
 PKGBUILD           |  25 +++
11
 4 files changed, 638 insertions(+)
12
13
diff --git a/Auto-PreInstall.sh b/Auto-PreInstall.sh
14
new file mode 100755
15
index 0000000..647a616
16
--- /dev/null
17
+++ b/Auto-PreInstall.sh
18
@@ -0,0 +1,140 @@
19
+#!/bin/sh
20
+#########################################################################################################################################################################################
21
+##                                                                A U T O L I N U X    B O O T S T R A P    S C R I P T                                                                ##
22
+#########################################################################################################################################################################################
23
+
24
+#                                                         _               _               _       __                         _  _                                                      # 
25
+#                                                        /.\     _    _  FJ_     ____    FJ      / J   _ _   _    _    _    FJ  LJ                                                     # 
26
+#                                                       //_\\   J |  | LJ  _|   F __ J  J |      LFJ  J ' \  J   J |  | L   J \/ F                                                     # 
27
+#                                                      / ___ \  | |  | || |-'  | |--| | | |      J  L | |\\   |  | |  | |   /    \                                                     # 
28
+#                                                     / L___J \ F L__J JF |__-.F L__J J F L_____ J  L F L \  JJ  F L__J J  /  /\  \                                                    # 
29
+#                                                    J__L   J__J\____,__\_____J\______/J________LJ__LJ__L \\J__LJ\____,__LJ__//\\__L                                                   # 
30
+#                                                    |__L   J__|J____,__J_____FJ______F|________||__||__L   J__| J____,__F|__/  \__|                                                   # 
31
+
32
+#########################################################################################################################################################################################
33
+#########################################################################################################################################################################################
34
+
35
+drives(){
36
+
37
+## If you would like to include any additional drives or partitions
38
+## in the file system table, please use the 'mkmnt' command, followed 
39
+## by a name for the folder in which you would like it to be mounted, 
40
+## followed by the name of partition ( NOT THE FULL PATH ). The 3 words 
41
+## should be seperated by a single space in between them. 
42
+
43
+## For example: ' mkmnt newFolderName partition/driveName '
44
+##            : '       mkmnt    myFolder    sda1         '
45
+
46
+# mkmnt 
47
+# mkmnt 
48
+# mkmnt 
49
+
50
+## If you have any extra swap partitions you would like to turn on,
51
+## insert them below, following '/dev/' for every line below..
52
+
53
+# swapon /dev/
54
+# swapon /dev/          
55
+# swapon /dev/          
56
+
57
+
58
+genfstab -U /mnt > /mnt/etc/fstab ; } 
59
+
60
+#########################################################################################################################################################################################
61
+
62
+srcdir=$(cd $(dirname ${BASH_SOURCE[0]}) && pwd && echo)
63
+
64
+msg(){ echo "$(tput bold; tput setaf 2)[+] ${*}$(tput sgr0)"; }
65
+
66
+err(){ echo >&2 "$(tput bold; tput setaf 1)[-] ERROR: ${*}$(tput sgr0)" && exit 1 ; }
67
+
68
+warn(){ echo >&2 "$(tput bold; tput setaf 1)[!] WARNING: ${*}$(tput sgr0)"; }
69
+
70
+check_root(){ [ "$(id -u)" -ne 0 ] && err "root priviledges are required to run this script."; }
71
+
72
+mkmnt(){ $(sudo mkdir -p /mnt/home/drives/"$1" >/dev/null 2>&1 && $(mount /dev/"$2" /mnt/home/drives/"$1") >/dev/null 2>&1) ; }
73
+
74
+fail(){ err "   ERROR! CATASTROPHIC FAILIURE CAPTAIN . . ." ; sleep 2 ; }
75
+
76
+requierments(){ pacman -Syy  figlet lolcat terminus-font sudo   --needed --noconfirm 2>/dev/null && setfont ter-p16n; }
77
+
78
+welcome(){ clear ; figlet -toc '|-WELCOME-| - TO - |-N U 1 L L 1 N U X-|' | lolcat ; sleep 1;
79
+    echo -e "\n\n  Please use 'cfdisk' (recommended) or 'fdisk' to partition your drive before running this script.\n  Generally, a 550M EFI partition, a 2-10G swap partition,  and the rest of space dedicated to linux filesystem.\n" ; sleep 5 ; }
80
+
81
+
82
+pac_conf(){
83
+echo -e "\n# GENERAL OPTIONS\n\n[options]\n\n#RootDir     = /\n#DBPath      = /var/lib/pacman/\n#CacheDir    = /var/cache/pacman/pkg/
84
+#LogFile     = /var/log/pacman.log\n#GPGDir      = /etc/pacman.d/gnupg/\n#HookDir     = /etc/pacman.d/hooks/\nHoldPkg      = pacman glibc
85
+#XferCommand = /usr/bin/curl -L -C - -f -o %o %u\n#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u\n#CleanMethod = KeepInstalled
86
+Architecture = auto\n\n#UseSyslog\nColor\nCheckSpace\nVerbosePkgLists\nILoveCandy\nParallelDownloads = 10\n\n\nSigLevel    = Required DatabaseOptional
87
+LocalFileSigLevel = Optional\n#RemoteFileSigLevel = Required\n\n\n[core]\nInclude = /etc/pacman.d/mirrorlist\n\n[extra]\nInclude = /etc/pacman.d/mirrorlist\n
88
+[community]\nInclude = /etc/pacman.d/mirrorlist\n\n[multilib]\nInclude = /etc/pacman.d/mirrorlist"; } 
89
+
90
+refreshkeys() { \
91
+  pacman -U --noconfirm https://gitlab.com/qyp/concise/-/raw/master/concise-keyring-1.0.3-1-any.pkg.tar.xz
92
+  /opt/Concise/init.sh ; }
93
+
94
+init(){  
95
+pac_conf > /etc/pacman.conf &&
96
+timedatectl set-ntp true ; }
97
+
98
+partitioning(){ 
99
+setfont ter-p16n &&
100
+
101
+echo  -e "\n    Please specify the boot partition:"                                  
102
+read -p "    ( Only the partition name, NOT the full path. )   : /dev/" boot 
103
+case "$boot" in 
104
+	''n) mkfs.vfat /dev/nvme0n1p1 ;;
105
+      s) mkfs.vfat /dev/sda4 ;;
106
+  	  *) mkfs.vfat /dev/"$boot"  
107
+esac 
108
+echo -e "\n    Please specify a swap partition if wanted,"                                  
109
+read -p "    ( Only the partition name, NOT the full path. )  :  /dev/" swap 
110
+case "$swap" in 
111
+	''n)
112
+	mkswap /dev/nvme0n1p2 && swapon /dev/nvme0n1p2 ;;
113
+      s) mkswap /dev/sda3 && swapon /dev/sda3 ;; 
114
+     "") ;; *) mkswap /dev/"$swap" && swapon /dev/"$swap" 
115
+esac
116
+echo -e "\n    Please specify partition name where base system will be installed. "                                 
117
+read -p "    ( Only the partition name, NOT the full path. )   :  /dev/" drive 
118
+case "$drive" in
119
+	''n) mkfs.ext4 /dev/nvme0n1p3 && mount /dev/nvme0n1p3 /mnt ;;
120
+      s) mkfs.ext4 /dev/sda5 && mount /dev/sda5 /mnt ;;
121
+	  *) mkfs.ext4 /dev/"$drive" && mount /dev/"$drive" /mnt 
122
+esac  
123
+
124
+[ ! -d /mnt/boot/EFI ] && mkdir -p /mnt/boot/EFI ;
125
+if [ $boot = n ]; then mount /dev/nvme0n1p1 /mnt/boot/EFI; fi
126
+if [ $boot = s ]; then mount /dev/sda4 /mnt/boot/EFI; fi
127
+mount /dev/$boot /mnt/boot/EFI 2>/dev/null ; clear ; setfont ter-p16n ;
128
+
129
+msg "  Partitioning Completed Successfully!"  || 
130
+err "Partitioning has failed miserably..." && sleep 2 && echo "" ; }
131
+
132
+base_install(){	msg "  Beginning base installation..." ; sleep 2 && setfont ter-p14n ;
133
+
134
+pacstrap /mnt \
135
+    base base-devel multilib-devel linux-firmware linux linux-headers --needed --noconfirm &&
136
+    pac_conf > /mnt/etc/pacman.conf && clear && setfont ter-p16n && 
137
+    msg "  The Base Installation was a Success!" && sleep 2 || fail ; }
138
+
139
+post_install(){ echo "" ; msg "  Installing additional system requierments..."; sleep 2 && setfont ter-p14n ;
140
+
141
+pacstrap /mnt \
142
+    archiso mkinitcpio mkinitcpio-archiso git curl neovim python-pynvim zsh ntfs-3g figlet xorg-xmodmap ufw networkmanager pulseaudio \
143
+    pulseaudio-bluetooth pulsemixer bluez bluez-tools bluez-plugins bluez-libs wget lolcat grub efibootmgr dosfstools mtools pacman-contrib fzf \
144
+    terminus-font os-prober  bash-completion --needed --noconfirm ; clear ; } 
145
+
146
+cp_scripts(){ cd $srcdir && cp AutoLinux.sh .skell /mnt/tmp/ ; cp AutoLinux.sh /mnt/bin/AutoLinux-installer >/dev/null 2>&1 ; }
147
+
148
+success(){ clear ; setfont ter-p16n && echo -e "" &&
149
+figlet -toc 'Success!'|lolcat ; echo -e "\n" ; sleep 2 && 
150
+arch-chroot /mnt AutoLinux-installer ; clear ; skell ; }
151
+
152
+check_root ; requierments ; refreshkeys ; 
153
+welcome ; init ; partitioning ; 
154
+base_install && post_install ; drives ; 
155
+cp_scripts ; success && exit 0 || fail && exit 1
156
+
157
+#########################################################################################################################################################################################
158
+#########################################################################################################################################################################################
159
diff --git a/AutoInstall.sh b/AutoInstall.sh
160
new file mode 100755
161
index 0000000..8445f68
162
--- /dev/null
163
+++ b/AutoInstall.sh
164
@@ -0,0 +1,444 @@
165
+#!/bin/sh
166
+#########################################################################################################################################################################################
167
+##                                                                A U T O L I N U X    B O O T S T R A P    S C R I P T                                                                ##
168
+#########################################################################################################################################################################################
169
+
170
+#                                                         _               _               _       __                         _  _                                                      # 
171
+#                                                        /.\     _    _  FJ_     ____    FJ      / J   _ _   _    _    _    FJ  LJ                                                     # 
172
+#                                                       //_\\   J |  | LJ  _|   F __ J  J |      LFJ  J ' \  J   J |  | L   J \/ F                                                     # 
173
+#                                                      / ___ \  | |  | || |-'  | |--| | | |      J  L | |\\   |  | |  | |   /    \                                                     # 
174
+#                                                     / L___J \ F L__J JF |__-.F L__J J F L_____ J  L F L \  JJ  F L__J J  /  /\  \                                                    # 
175
+#                                                    J__L   J__J\____,__\_____J\______/J________LJ__LJ__L \\J__LJ\____,__LJ__//\\__L                                                   # 
176
+#                                                    |__L   J__|J____,__J_____FJ______F|________||__||__L   J__| J____,__F|__/  \__|                                                   # 
177
+
178
+#########################################################################################################################################################################################
179
+#########################################################################################################################################################################################
180
+
181
+ #-------------------------------#
182
+## ### VARIABLES & FUNCTIONS ### ##
183
+ #-------------------------------#
184
+
185
+
186
+pkgdir="/opt"
187
+
188
+aurhelper="yay"
189
+
190
+mirlist="/etc/pacman.d/mirrorlist"
191
+
192
+lmirlist="/etc/pacman.d/local-mirrorlist"
193
+
194
+dotfiles="https://gitlab.com/qyp/dotfiles.git"
195
+
196
+
197
+arch="$(uname -m)"
198
+
199
+srcdir=$(cd $(dirname ${BASH_SOURCE[0]}) && pwd && echo)
200
+
201
+area="$(curl -4 ifconfig.co/country-iso)"           
202
+
203
+bootid="$(lsblk|grep boot |sed 's/p.*$//;s/├─//;s/└─//'|sed 's/^/\/dev\//;s/$/\//')"
204
+
205
+rmdblck="$([ -f /var/lib/pacman/db.lck ] && rm -rf /var/lib/pacman/db.lck)"
206
+
207
+
208
+installpkg(){ pacman --noconfirm --needed -S "$*" >/dev/null 2>&1 ; }
209
+
210
+check_root(){ [ "$(id -u)" -ne 0 ] && err "Root priviledges are required to run this script!"; }
211
+
212
+err(){ echo >&2 "$(tput bold; tput setaf 1)[-] ERROR: ${*}$(tput sgr0)" && $rmdblck ; exit 1337; }
213
+
214
+
215
+newmirrors(){ \
216
+    dialog --infobox " Testing fastest mirrors for most efficient downloads..." 4 50
217
+    mv /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup && reflector --sort rate -a48 -f20 -l20 -c 'ZA,US,UK,Germany,Netherlands' \
218
+-p 'http,https' --save /etc/pacman.d/mirrorlist >/dev/null 2>&1  ; }
219
+
220
+initmsg1(){ \
221
+	dialog --title " Welcome to AutoLinux! " --msgbox "\\n             Welcome, and thank you for choosing AutoLinux!\\n\\n    This script will now install the AutoLinux edition of your choice.\\n" 9 80 ; }
222
+
223
+whichedition(){
224
+  edition="$(dialog --colors --menu "   Please Select the AutoLinux Edition to Install :" 12 55 1 1 "DWM                                        " 2 "Plasma                                     "   3>&1 1>&2 2>&3 3>&1)" ; }
225
+
226
+initmsg2(){
227
+	dialog --colors --title " Please Note :" --yes-label " Lets Boogie! " --no-label " Lets not boogie :| " --yesno "\\n  An Arch Linux, or Arch based system is required for the installation of AutoLinux.\\n\\n       If you are running any other distrobution the installation will fail." 9 90 ; }
228
+
229
+user_and_password() {
230
+	name=$(dialog --inputbox " Please enter a name for the user account: " 10 60 3>&1 1>&2 2>&3 3>&1) || exit 1
231
+	while ! echo "$name" | grep -q "^[a-z_][a-z0-9_-]*$"; do
232
+		name=$(dialog --no-cancel --inputbox "Username not valid. Give a username beginning with a letter, with only lowercase letters, - or _." 10 60 3>&1 1>&2 2>&3 3>&1)
233
+	done
234
+	pass1=$(dialog --no-cancel --passwordbox "Enter a password for that user:" 10 60 3>&1 1>&2 2>&3 3>&1)
235
+	pass2=$(dialog --no-cancel --passwordbox "Retype the password." 10 60 3>&1 1>&2 2>&3 3>&1)
236
+	while ! [ "$pass1" = "$pass2" ]; do
237
+		unset pass2
238
+		pass1=$(dialog --no-cancel --passwordbox "Passwords do not match.\\n\\nEnter password again." 10 60 3>&1 1>&2 2>&3 3>&1)
239
+		pass2=$(dialog --no-cancel --passwordbox "Retype password." 10 60 3>&1 1>&2 2>&3 3>&1)
240
+	done ; }
241
+
242
+root_user_password(){
243
+    pass3=$(dialog --no-cancel --passwordbox "Enter a password for the root user:" 10 60 3>&1 1>&2 2>&3 3>&1)
244
+	pass4=$(dialog --no-cancel --passwordbox "Retype the password." 10 60 3>&1 1>&2 2>&3 3>&1)
245
+	while ! [ "$pass3" = "$pass4" ]; do
246
+		unset pass2
247
+		pass3=$(dialog --no-cancel --passwordbox "Passwords do not match.\\n\\nEnter password again." 10 60 3>&1 1>&2 2>&3 3>&1)
248
+		pass4=$(dialog --no-cancel --passwordbox "Retype password." 10 60 3>&1 1>&2 2>&3 3>&1)
249
+    done ; }
250
+
251
+usercheck() { \
252
+	! { id -u "$name" >/dev/null 2>&1; } ||
253
+	dialog --colors --title "WARNING!" --yes-label " CONTINUE " --no-label " RETURN " --yesno "\nThe user '$name' already exists on this system. AutoLinux can install for this user, but will overwrite any existing configuration files existing on \\nthis users account. \\n\\nHowever, it will not overwrite any other user files, documents, videos, or personal files of any sorts.\\n\\nIrrespective, only click <CONTINUE> if you are certain you have backed up any wanted system 'config' files.\\n\\nThe users password will also be changed to the one you just provided." 17 85 ; }
254
+
255
+preinstall() { \
256
+	dialog --title " The calm before the STORM!" --yes-label "CONTINUE" --no-label " EXIT " --yesno "\\nThe rest of the proccess is automated and might take a while, depending on your connection. \\n\\nSo sit back, relax and please do not stop the process if it seems stuck.\\n\\nSome packages just take longer to compile than others.\\n\\n\\n  Ready when you are?" 16 60 ; }
257
+
258
+
259
+adduserandpass() { \
260
+	dialog --infobox " Adding user \"$name\"..." 4 50
261
+	useradd -m "$name"  >/dev/null 2>&1
262
+	usermod -aG wheel,audio,optical,video,kvm,network,adm "$name" && chown $name /home/"$name"  >/dev/null 2>&1
263
+	export repodir="/home/$name/.local/src"; mkdir -p "$repodir"; chown -R "$name":wheel "$(dirname "$repodir")"
264
+	echo "$name:$pass1" | chpasswd >/dev/null 2>&1
265
+	unset pass1 pass2 ; }
266
+
267
+setrootpass(){
268
+	dialog --infobox " Changing password for root user..." 4 50
269
+	echo "root:$pass3" | chpasswd >/dev/null 2>&1
270
+	unset pass3 pass4 ; }
271
+
272
+bootload(){
273
+    dialog --colors --title " Clean Install or Existing System? " --yes-label " Install GRUB! " --no-label " I have a bootloader. " --yesno "\\n Would you like AutoLinux to install the GRUB bootloader? \\n\\n If it is your first time installing an OS and you have not yet installed or \n configured a bootloader, then selecting 'yes' would be a required for the \n system to function or boot." 11 100 &&
274
+        loader="$?" ; }
275
+
276
+addmirrors(){
277
+    dialog --colors --title " Additional Mirrors and Repositories " --yes-label " Yes, Add Them! " --no-label " No Thanks. " --yesno "\\n Would you like to add the additional Mirrors and Repositories to the build?\\n\\n These mirrors would be beneficial as they would give you access/availability to many extra\n resources and repositories to acquire packages and other software.\n\n\n NOTE: Adding these extra mirrors would also significantly speed up the installation process,\n since you will be downloading binary versions of most aur packages, instead of compiling  \n everything from source." 15 100
278
+        yesmir="$?" ; }
279
+
280
+chshell(){
281
+chsh -s /bin/zsh >/dev/null 2>&1
282
+chsh -s /bin/zsh "$name" >/dev/null 2>&1
283
+sudo -u "$name" mkdir -p "/home/$name/.cache/zsh/" ; }
284
+
285
+refreshkeys() { \
286
+		dialog --infobox "Refreshing Arch Keyring..." 4 40
287
+		pacman --noconfirm -S archlinux-keyring >/dev/null 2>&1
288
+		dialog --infobox "Adding Concise Keyring..." 4 40
289
+
290
+  yes|pacman-key --recv-key 3E550ACE369CFA1BEE0ABA6E8C85178C555A3C06 --keyserver keyserver.ubuntu.com >/dev/null 2>&1 
291
+  yes|pacman-key --lsign-key 3E550ACE369CFA1BEE0ABA6E8C85178C555A3C06  >/dev/null 2>&1
292
+  yes|pacman -U 'https://gitlab.com/qyp/concise/-/raw/master/x86_64/concise-keyring-1.0.2-1-any.pkg.tar.zst' >/dev/null 2>&1
293
+	
294
+  cat /etc/pacman.conf|grep -q "^\[concise\]"|| cat << EOF >>/etc/pacman.conf
295
+    
296
+[concise]
297
+SigLevel = Required DatabaseOptional
298
+Server = https://gitlab.com/qYp/\$repo/-/raw/master/\$arch
299
+
300
+EOF
301
+  dialog --infobox "Updating Repos and Keys..." 4 40  
302
+  for repo in core extra community multilib; do
303
+  grep -q "^\[$repo\]" /etc/pacman.conf || echo "[$repo]
304
+Include = /etc/pacman.d/mirrorlist
305
+" >> /etc/pacman.conf
306
+done
307
+
308
+    pacman-key --init >/dev/null 2>&1 
309
+    pacman-key --populate >/dev/null 2>&1
310
+    pacman -Syy >/dev/null 2>&1
311
+}
312
+
313
+sudoers(){ echo -e "\n$*" >> /etc/sudoers ; }
314
+
315
+gpudrivers(){ \
316
+    dialog --infobox " Detecting Graphics Card..." 4 40
317
+    local GPU="$(neofetch |grep GPU|sed 's/^\.*.s//' |cut -d" " -f2)"
318
+	
319
+    case $GPU in
320
+        AMD) dialog --infobox " Installing AMD GPU Drivers..." 4 40
321
+	    yes|pacman -S  --needed xf86-video-amdgpu >/dev/null 2>&1 ;;
322
+        NVIDIA)  dialog --infobox " Installing NVIDIA GPU Drivers..." 4 40
323
+	    yes|pacman -S  --needed nvidia-470xx-dkms nvidia-470xx-settings nvidia-470xx-utils >/dev/null 2>&1 ;;
324
+        Intel)   dialog --infobox " Installing Intel GPU Drivers..." 4 40
325
+	    yes|pacman -S --needed vulkan-intel xf86-video-intel intel-gpu-tools >/dev/null 2>&1 ;;
326
+        Radeon) dialog --infobox " Installing Radeon GPU Drivers..." 4 40
327
+	    yes|pacman -S  --needed opencl-mesa vulkan-raedon >/dev/null 2>&1 ;;
328
+             *)  dialog --infobox " Unknown GPU Detected, Skipping GPU Driver Installation..." 4 40 && sleep 2 ;;
329
+
330
+    esac; unset x ; }
331
+
332
+cpudrivers(){ \
333
+    dialog --infobox " Detecting CPU..." 4 40
334
+    local CPU="$(neofetch |grep CPU |sed 's/^\.*.s//' |cut -d" " -f2)"
335
+    
336
+    case $CPU in
337
+        Intel) dialog --infobox " Installing Intel CPU Drivers..." 4 40
338
+            yes|pacman -S --needed intel-ucode >/dev/null 2>&1 ;;
339
+          AMD) dialog --infobox " Installing AMD CPU Drivers..." 4 40
340
+            yes|pacman -S --needed amd-ucode >/dev/null 2>&1 ;;
341
+            *) dialog --infobox " Unknown CPU Detected, Skipping CPU Driver Installation..." 4 40 ; sleep 2 ;;
342
+
343
+    esac ; unset x ; }
344
+
345
+replacedir(){ \
346
+    dialog --infobox "Installing AutoLinux custom builds of '$(basename "$1")' ($n of $total).  $2" 5 70
347
+	destdir="/usr/share"
348
+	clonename="$(basename "$1" .git)"
349
+    clonepath="$destdir/$clonename"
350
+	[ -e "$clonepath" ] && sudo mv $clonepath "$clonepath'-old'" ;
351
+	git clone "$1" $clonepath  >/dev/null 2>&1
352
+	cd /tmp || return 1 ; }
353
+
354
+archlinuxinstall(){
355
+    dialog --infobox "Installing "$1", an AUR helper..." 4 50
356
+	[ -d "$pkgdir"/"$1" ] && rm -rf "$pkgdir"/"$1" ;
357
+    sudo git clone --depth 1 https://aur.archlinux.org/"$1".git $pkgdir/"$1" >/dev/null 2>&1 ;
358
+	chown "$name":wheel $pkgdir/"$1" ||{ cd "$pkgdir/$1" || return 1 ; sudo -u "$name" git pull --force origin master;}
359
+	cd "$pkgdir/$1"&&sudo -u "$name" makepkg --noconfirm -si >/dev/null 2>&1 || return 1 ; cd /tmp ; }
360
+
361
+maininstall(){
362
+	dialog --title "AutoLinux Installation" --infobox "Installing '$1' ($n of $total).   $2" 5 70
363
+	installpkg "$1" ; }
364
+
365
+gitinstall(){
366
+	progname="$(basename "$1" .git)"
367
+	dir="$repodir/$progname"
368
+	dialog --title "AutoLinux Installation" --infobox "Cloning and Building '$progname' ($n of $total). '$(basename "$1")' $2" 5 70
369
+	sudo -u "$name" git clone --depth 1 "$1" "$dir" >/dev/null 2>&1 || { cd "$dir" || return 1 ; sudo -u "$name" git pull --force origin master;}
370
+	cd "$dir" || exit 1
371
+	makepkg -sri >/dev/null 2>&1
372
+	cd /tmp || return 1 ; }
373
+
374
+gitcompile(){
375
+	progname="$(basename "$1" .git)"
376
+    dir="$repodir/$progname"
377
+	dialog --title "AutoLinux Installation" --infobox "Installing the AutoLinux  build of '$progname' ($n of $total). $(basename "$1") $2" 5 70
378
+	sudo -u "$name" git clone --depth 1 "$1" "$dir" >/dev/null 2>&1 || { cd "$dir" || return 1 ; sudo -u "$name" git pull --force origin master;}
379
+	cd "$dir" || exit 1
380
+	make >/dev/null 2>&1
381
+	make install >/dev/null 2>&1
382
+	cd /tmp || return 1 ; }
383
+
384
+aurinstall(){ \
385
+	dialog --title "AutoLinux Installation" --infobox "Installing '$1' ($n of $total) from the AUR. $2" 5 70
386
+	echo "$aurinstalled" | grep -q "^$1$" && return 1
387
+	sudo -u "$name" $aurhelper -S --noconfirm "$1" >/dev/null 2>&1
388
+	}
389
+
390
+pipinstall(){ \
391
+	dialog --title "AutoLinux Installation" --infobox "Installing the Python package '$1' ($n of $total). $2" 5 70
392
+	[ -x "$(command -v "pip")" ] || installpkg python-pip >/dev/null 2>&1
393
+	yes | pip install "$1" ; }
394
+
395
+installationloop(){ \
396
+	([ -f "$pkgsfile" ] && cp "$pkgsfile" /tmp/pkgs.csv) || curl -Ls "$pkgsfile" | sed '/^#/d' > /tmp/pkgs.csv
397
+	total=$(wc -l < /tmp/pkgs.csv)
398
+	aurinstalled=$(pacman -Qqm)
399
+	while IFS=, read -r tag program comment; do
400
+		n=$((n+1))
401
+		echo "$comment" | grep -q "^\".*\"$" && comment="$(echo "$comment" | sed "s/\(^\"\|\"$\)//g")"
402
+		case "$tag" in
403
+			"A") aurinstall "$program" "$comment" ;;
404
+			"M") gitinstall "$program" "$comment" ;;
405
+			"G") gitcompile "$program" "$comment" ;;
406
+			"P") pipinstall "$program" "$comment" ;;
407
+			"R") replacedir "$program" "$comment" ;;
408
+		     *) maininstall "$program" "$comment" ;;
409
+		esac
410
+	done < /tmp/pkgs.csv ; }
411
+
412
+placeconfigs() {
413
+	dialog --infobox " Downloading and installing config files..." 4 60
414
+	branch="$gitbranch" ; dir=$(mktemp -d)
415
+	[ ! -d "$2" ] && mkdir -p "$2"
416
+	chown "$name":wheel "$dir" "$2"
417
+	sudo -u "$name" git clone --recursive -b "$branch" --depth 1 --recurse-submodules "$1" "$dir" >/dev/null 2>&1
418
+	sudo -u "$name" cp -rfT "$dir" "$2" ; }
419
+
420
+systembeepoff() { dialog --infobox "Getting rid of that retarded error beep sound..." 4 40
421
+	rmmod pcspkr >/dev/null 2>&1 & echo "blacklist pcspkr" > /etc/modprobe.d/nobeep.conf >/dev/null 2>&1 ; sleep 2 ; }
422
+
423
+promptfix(){ \
424
+    dialog --infobox " Fixing Shell Syntax Coloring Issue..." 4 45
425
+    pacman -R lolcat --noconfirm >/dev/null 2>&1 
426
+    sudo -u $name paru -S --noconfirm python-lolcat >/dev/null 2>&1 ; }
427
+
428
+mirrors(){
429
+cd /tmp
430
+    dialog --infobox " Adding ArcoLinux Mirrors and Keys..." 4 50
431
+    sudo wget https://github.com/arcolinux/arcolinux_repo/raw/master/x86_64/arcolinux-keyring-20230919-6-any.pkg.tar.zst -O /tmp/arcolinux-keyring-20230919-6-any.pkg.tar.zst >/dev/null 2>&1
432
+yes |sudo pacman -U --noconfirm --needed /tmp/arcolinux-keyring-20230919-6-any.pkg.tar.zst >/dev/null 2>&1
433
+    sudo wget https://raw.githubusercontent.com/arcolinux/arcolinux-mirrorlist/master/etc/pacman.d/arcolinux-mirrorlist -O /etc/pacman.d/arcolinux-mirrorlist  >/dev/null 2>&1
434
+sed -i '/arcolinux_repo/{N;d}' /etc/pacman.conf; sed -i '/arcolinux_repo_3party/{N;d}' /etc/pacman.conf; sed -i '/arcolinux_repo_xlarge/{N;d}' /etc/pacman.conf ;
435
+echo -e "[arcolinux_repo]\nInclude = /etc/pacman.d/arcolinux-mirrorlist\n\n[arcolinux_repo_3party]\nInclude = /etc/pacman.d/arcolinux-mirrorlist\n\n[arcolinux_repo_xlarge]\nInclude = /etc/pacman.d/arcolinux-mirrorlist\n" >> /etc/pacman.conf ;
436
+
437
+    dialog --infobox " Adding Chaotic Mirrors and Keys..." 4 50 &&
438
+yes|pacman-key --recv-key FBA220DFC880C036 --keyserver keyserver.ubuntu.com >/dev/null 2>&1
439
+yes|pacman-key --lsign-key FBA220DFC880C036 >/dev/null 2>&1
440
+yes|pacman -U \
441
+    'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst'  >/dev/null 2>&1 \
442
+    'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst' >/dev/null 2>&1 &&
443
+sed -i '/chaotic-aur/{N;d}' /etc/pacman.conf
444
+echo -e "[chaotic-aur]\nInclude = /etc/pacman.d/chaotic-mirrorlist\n" >> /etc/pacman.conf ;
445
+
446
+  dialog --infobox " Adding BlackArch Mirrors and Keys..." 4 50  &&
447
+curl -LO blackarch.org/strap.sh >/dev/null 2>&1  &&
448
+echo 46f035c31d758c077cce8f16cf9381e8def937bb strap.sh | sha1sum -c >/dev/null 2>&1  &&
449
+chmod +x strap.sh  ; sudo sh strap.sh >/dev/null 2>&1 &&
450
+
451
+  dialog --infobox " Updating System Keys and Mirrors..." 4 50
452
+yes|pacman -Syyu >/dev/null 2>&1 ; }
453
+
454
+system_config(){ \
455
+	hostname="AutoLinux"
456
+	dialog --infobox "Setting System Information..." 4 40 ; sleep 2 &&
457
+
458
+	grep -q "ILoveCandy" /etc/pacman.conf || sed -i "/#VerbosePkgLists/a ILoveCandy" /etc/pacman.conf
459
+	sed -i "s/^#ParallelDownloads = *.*$/ParallelDownloads = 10/;s/^#Color$/Color/" /etc/pacman.conf
460
+	echo "$hostname" > /etc/hostname
461
+
462
+    [ -f /etc/localtime ] && rm /etc/localtime ;
463
+    ln -sF /usr/share/zoneinfo/Africa/Harare /etc/localtime
464
+	sed -i 's/#en_US.UTF-8/en_US.UTF-8/g' /etc/locale.gen
465
+	sed -i 's/#en_ZA.UTF-8/en_ZA.UTF-8/g' /etc/locale.gen
466
+	sed -i "s/#en_"$area".UTF-8/en_"$area".UTF-8/g" /etc/locale.gen
467
+	echo -e "\nLANG=en_ZA.UTF-8\nLANG=en_US.UTF-8" > /etc/locale.conf &&
468
+    [ "$(cat /etc/locale.conf|grep "$area"|wc -l)" -eq "0" ] && 
469
+    echo "LANG=en_"$area".UTF-8" >>/etc/locale.conf ; locale-gen &>/dev/null
470
+	echo -e "127.0.0.1     localhost\n::1     localhost\n127.0.1.1     $hostname.localhost $hostname" >/etc/hosts
471
+    [ $edition = "2" ] && systemctl enable sddm.service >/dev/null 2>&1 
472
+	systemctl enable NetworkManager.service >/dev/null 2>&1
473
+    systemctl enable bluetooth-autoconnect.service >/dev/null 2>&1
474
+    systemctl enable bluetooth.service >/dev/null 2>&1
475
+	[ $edition = "1" ] && systemctl enable mpd.service >/dev/null 2>&1
476
+  rm -rf /tmp/pulse* ~/.pulse* ~/.config/pulse /home/$name/.pulse* /home/$name/.config/pulse* ; }
477
+
478
+xftlib(){ \                                            
479
+    dialog --title "AutoLinux Installation" --infobox "Lastly installing 'libxft-bgra' .\nSuckless software to display color emojis without causing any errors." 6 80
480
+    ! pacman -Qq libxft-bgra >/dev/null 2>&1 && pacman -R --noconfirm libxft-bgra >/dev/null 2>&1 ;
481
+    yes | sudo -u "$name" $aurhelper -S libxft-bgra-git >/dev/null 2>&1 ; }
482
+
483
+
484
+grub(){ \
485
+    dialog --infobox "Initiating Bootloader..." 4 40
486
+        [ -d /sys/firmware/efi/efivars ] && pacman -S --noconfirm --needed grub efibootmgr >/dev/null 2>&1 &&
487
+            grub-install --target=x86_64-efi --bootloader-id=AutoLinux --recheck >/dev/null 2>&1 ;
488
+        ! [ -d /sys/firmware/efi/efivars ] && pacman -S --noconfirm --needed grub >/dev/null 2>&1 &&
489
+            grub-install --target=i386-pc --bootloader-id=AutoLinux --force  >/dev/null 2>&1 ;
490
+            grub-mkconfig -o /boot/grub/grub.cfg >/dev/null 2>&1 ; }                
491
+
492
+grubtheme(){ \
493
+	dialog --infobox "Setting Grub theme..." 4 30 
494
+    sleep 1 && mkdir -p /boot/grub/themes/AutoLinux &&
495
+    cp /home/$name/.local/share/wallpapers/0.jpg /boot/grub/themes/AutoLinux/wp1.jpg  >/dev/null 2>&1 
496
+    sed -i 's/#GRUB_BACKGROUND.*/GRUB_BACKGROUND="\/boot\/grub\/themes\/AutoLinux\/wp1.jpg"/g' /etc/default/grub >/dev/null 2>&1
497
+    sed -i 's/GRUB_BACKGROUND.*/GRUB_BACKGROUND="\/boot\/grub\/themes\/AutoLinux\/wp1.jpg"/g' /etc/default/grub >/dev/null 2>&1
498
+    sed -i 's/GRUB_TIMEOUT=.*/GRUB_TIMEOUT=10/g' /etc/default/grub >/dev/null 2>&1
499
+    sed -i 's/#GRUB_GFXMODE.*/GRUB_GFXMODE=1920x1080x32/g' /etc/default/grub >/dev/null 2>&1
500
+}
501
+
502
+
503
+finalize(){ \
504
+	dialog --infobox "Preparing welcome message..." 4 50
505
+    [ $edition = "1" ] && dialog --title "Time to Celebrate!" --msgbox "\\nInstallation completed successfully! Provided there were no hidden errors, all the programs and configuration files should be in place.\\n\\nTo run the new graphical environment, log out and log back in as your new user, then run the command 'startx' to start the graphical environment \\n(it will start automatically in tty1).\\n\\n Enjoy AutoLinux!   - dqYpb" 13 80 ; 
506
+    [ $edition = "2" ] && sed -i 's/Name=.*$/Name=AutoLinux (Plasma)/g' /usr/share/xsessions/plasma.desktop && cp -r /home/$name/.local/bin/* /usr/local/bin/ &&
507
+      dialog --title "Time to Celebrate" --msgbox "\\n                     The AutoLinux installation process has completed successfully\!\\n\\n\\n   Provided there were no hidden errors, all the programs and configuration files should be in place.\\n\\nautolinux-Plasma will automatically start up in the login manager the next time you reboot your computer.\\n\\n\\n\\n Enjoy AutoLinux!   - dqYpb" 17 110 ; }
508
+
509
+
510
+rebootmsg(){ \
511
+    i=10 ; i=$i ; clear
512
+    until [ $i -lt 0 ] ; do
513
+    echo -e " Exiting in: $i\n" | figlet -tc |lolcat && sleep 1 && clear &&
514
+    ((i=$i-1)) ; done && umount -l /mnt && exit 0 || rebootmsg ; }
515
+
516
+
517
+
518
+### SCRIPT BEGIN ###
519
+
520
+check_root
521
+
522
+installpkg dialog || err "Root priviledges are required to run this script!"
523
+
524
+initmsg1 || err "User exited."
525
+
526
+initmsg2 || err "User exited."
527
+
528
+whichedition || err "User exited."
529
+
530
+user_and_password || err "User exited."
531
+
532
+root_user_password || err "User exited."
533
+
534
+usercheck || err "User exited."
535
+
536
+bootload
537
+
538
+preinstall || err "User exited."
539
+
540
+refreshkeys || err "Automatically refreshing Arch keyring. Consider doing so manually."
541
+
542
+for x in curl ca-certificates base-devel archlinux-keyring hwinfo neofetch rsync git ntp zsh ; do
543
+	dialog --title "AutoLinux Installation" --infobox "Installing '$x' which is required to install and configure other programs." 5 70
544
+	installpkg "$x"
545
+done
546
+
547
+pacman-key --init >/dev/null 2>&1; pacman-key --populate >/dev/null 2>&1
548
+dialog --title "AutoLinux Installation" --infobox "Synchronizing system time to ensure successful and secure installation of software..." 4 70
549
+ntpdate 0.us.pool.ntp.org >/dev/null 2>&1
550
+
551
+# newmirrors || err "User exited." 
552
+
553
+adduserandpass || err "Adding username and/or password."
554
+
555
+setrootpass || err "Changing root password."
556
+
557
+sudoers "%wheel ALL=(ALL) NOPASSWD: ALL #AutoLinux"
558
+
559
+
560
+[ -f /etc/sudoers.pacnew ] && cp /etc/sudoers.pacnew /etc/sudoers 
561
+
562
+
563
+archlinuxinstall yay-bin
564
+
565
+
566
+[ $edition = "1" ] && pkgsfile="https://gitlab.com/qYp/autolinux/-/raw/pkgs/dwm.csv" && gitbranch="dwm"
567
+
568
+[ $edition = "2" ] && pkgsfile="https://gitlab.com/qYp/autolinux/-/raw/pkgs/plasma.csv" && gitbranch="plasma"
569
+
570
+
571
+installationloop ; cpudrivers ; gpudrivers  
572
+                           
573
+[ $edition = "1" ] && xftlib
574
+
575
+systembeepoff ; promptfix 
576
+
577
+
578
+placeconfigs "$dotfiles" "/home/$name" "$gitbranch" && rm -rf "/home/$name/.git"
579
+          
580
+chshell || err "Changing default shell for root and "$name"."
581
+
582
+
583
+mkdir -p /etc/X11/xinit/xinitrc.d >/dev/null 2>&1 &&
584
+    [ -f /home/$name/.config/shell/profile ] && cat /home/$name/.config/shell/profile > /etc/zsh/zprofile >/dev/null 2>&1
585
+    [ -f /home/$name/.config/x11/xinitrc ] && cat /home/$name/.config/x11/xinitrc > /etc/X11/xinit/xinitrc >/dev/null 2>&1
586
+
587
+[ -d /root/.config ] && mv /root/.config /root/.config-old >/dev/null 2>&1 
588
+[ -d /root/.local/ ] && mv /root/.local/ /root/.local-old >/dev/null 2>&1
589
+    ln -s /home/$name/{.config,.local/} /root >/dev/null 2>&1 &&
590
+    cp /home/$name/.config/shell/profile /root/.zprofile >/dev/null 2>&1
591
+
592
+[ $edition = "1" ] && cp /home/$name/.local/src/dwm/dwm /usr/bin/dwm && 
593
+    cp /home/$name/.local/src/dwm/dwm /usr/bin/AutoLinux-dwm
594
+
595
+[ $edition = "2" ] && pacman -S plasma-desktop plasma-meta  --noconfirm   >/dev/null 2>&1 && 
596
+    cp /usr/bin/startplasma-x11 /usr/bin/AutoLinux-plasma  >/dev/null 2>&1
597
+
598
+grep -q "OTHER_OPTS='-a pulseaudio -m alsa_seq -r 48000'" /etc/conf.d/fluidsynth ||
599
+	echo "OTHER_OPTS='-a pulseaudio -m alsa_seq -r 48000'" >> /etc/conf.d/fluidsynth
600
+
601
+[ "$loader" = "0" ] && 
602
+    grub && grubtheme ; pkill -15 -x 'pulseaudio' ; 
603
+    sudo -u "$name" pulseaudio --start ; system_config ; 
604
+    finalize ; clear ; skell
605
+
606
+
607
+#########################################################################################################################################################################################
608
+#########################################################################################################################################################################################
609
diff --git a/LICENSE b/LICENSE
610
new file mode 100644
611
index 0000000..cafb61c
612
--- /dev/null
613
+++ b/LICENSE
614
@@ -0,0 +1,29 @@
615
+MIT/X Consortium License
616
+
617
+Creator and Maintainer :
618
+© 2021-2022 Connor Etherington <[email protected]>
619
+---------------------------------------------------------------------------
620
+Contributors:
621
+
622
+
623
+---------------------------------------------------------------------------
624
+
625
+Permission is hereby granted, free of charge, to any person obtaining a copy
626
+of this software and associated documentation files (the "Software"), to deal
627
+in the Software without restriction, including without limitation the rights
628
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
629
+copies of the Software, and to permit persons to whom the Software is
630
+furnished to do so, subject to the following conditions:
631
+
632
+THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN ALL
633
+COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE.
634
+
635
+
636
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
637
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
638
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
639
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
640
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
641
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
642
+SOFTWARE.
643
+
644
diff --git a/PKGBUILD b/PKGBUILD
645
new file mode 100644
646
index 0000000..7e56898
647
--- /dev/null
648
+++ b/PKGBUILD
649
@@ -0,0 +1,25 @@
650
+# Maintainer: Connor Etherington <[email protected]>
651
+# ---
652
+_pkgname=AutoLinux
653
+pkgname=auto
654
+pkgver=2.0.1
655
+pkgrel=1
656
+pkgdesc='AutoLinux bootstrap scripts, with optional riced configs for the AutoLinux platform'
657
+arch=(x86_64)
658
+url="https://gitlab.com/qYp/${_pkgname}"
659
+license=('MIT')
660
+depends=(dialog)
661
+makedepends=(git)                 
662
+source=("git+$url.git")
663
+sha256sums=('SKIP')
664
+
665
+pkgver() {
666
+  printf "2.0.$(git rev-list --count HEAD)"
667
+}
668
+
669
+package() {
670
+  cd "$srcdir"
671
+    install -Dm755 ${pkgname}/{AutoLinux.sh,pre-install.sh} -t "${pkgdir}/opt/${_pkgname}"
672
+    install -Dm755 ${pkgname}/AutoLinux.sh "${pkgdir}/usr/bin/${_pkgname}"
673
+    install -Dm644 ${pkgname}/LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
674
+}