summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--zirless.sh (renamed from larbs.sh)24
1 files changed, 20 insertions, 4 deletions
diff --git a/larbs.sh b/zirless.sh
index 110d9c8..6499d92 100644
--- a/larbs.sh
+++ b/zirless.sh
@@ -58,9 +58,9 @@ preinstallmsg() { \
adduserandpass() { \
# Adds user `$name` with password $pass1.
dialog --infobox "Adding user \"$name\"..." 4 50
- useradd -m -g wheel -s /bin/zsh "$name" >/dev/null 2>&1 ||
- usermod -a -G wheel "$name" && mkdir -p /home/"$name" && chown "$name":wheel /home/"$name"
- repodir="/home/$name/.local/src"; mkdir -p "$repodir"; chown -R "$name":wheel "$(dirname "$repodir")"
+ useradd -m -s /bin/zsh "$name" >/dev/null 2>&1 ||
+ usermod -a -G wheel "$name" && mkdir -p /home/"$name" && chown "$name:$name" /home/"$name"
+ repodir="/home/$name/.local/src"; mkdir -p "$repodir"; chown -R "$name:$name" "$(dirname "$repodir")"
echo "$name:$pass1" | chpasswd
unset pass1 pass2 ;}
@@ -74,6 +74,19 @@ newperms() { # Set special sudoers settings for install (or after).
sed -i "/#ZIRLESS/d" /etc/sudoers
echo "$* #ZIRLESS" >> /etc/sudoers ;}
+artixaddarchrepos() { # Adds the Arch repos to Artix Linux (some ZIRLESS packages require it)
+ sudo -u "$name" pacman -S --noconfirm artix-archlinux-support archlinux-mirrorlist archlinux-keyring >/dev/null 2>&1 || exit 3
+ grep -q '[extra]\|[community]' /etc/pacman.conf || sudo -u "$name" echo "
+[extra]
+Include = /etc/pacman.d/mirrorlist-arch
+
+[community]
+Include = /etc/pacman.d/mirrorlist-arch
+
+[multilib]
+Include = /etc/pacman.d/mirrorlist-arch
+" >> /etc/pacman.conf >/dev/null 2>&1 ;}
+
manualinstall() { # Installs $1 manually if not installed. Used only for AUR helper here.
[ -f "/usr/bin/$1" ] || (
dialog --infobox "Installing \"$1\", an AUR helper..." 4 50
@@ -199,13 +212,16 @@ newperms "%wheel ALL=(ALL) NOPASSWD: ALL"
# Make pacman and paru colorful and adds eye candy on the progress bar because why not.
grep -q "^Color" /etc/pacman.conf || sed -i "s/^#Color$/Color/" /etc/pacman.conf
-grep -q "ILoveCandy" /etc/pacman.conf || sed -i "/#VerbosePkgLists/a ILoveCandy" /etc/pacman.conf
+grep -q "ILoveCandy" /etc/pacman.conf || sed -i "/#VerbosePkgLists/a #ILoveCandy" /etc/pacman.conf
+grep -q "ParallelDownloads" /etc/pacman.conf || sed -i "/ILoveCandy/a ParallelDownloads = 6" /etc/pacman.conf
# Use all cores for compilation.
sed -i "s/-j2/-j$(nproc)/;s/^#MAKEFLAGS/MAKEFLAGS/" /etc/makepkg.conf
manualinstall yay-bin || error "Failed to install AUR helper."
+artixaddarchrepos
+
# The command that does all the installing. Reads the progs.csv file and
# installs each needed program the way required. Be sure to run this only after
# the user has been created and has priviledges to run sudo without a password