arch-specific commands run only on arch
This commit is contained in:
parent
1f2f25dd8e
commit
a757df2c13
1 changed files with 19 additions and 15 deletions
34
larbs.sh
34
larbs.sh
|
@ -28,6 +28,7 @@ elif type apt >/dev/null 2>&1; then
|
||||||
installpkg(){ apt-get install -y "$1" >/dev/null 2>&1 ;}
|
installpkg(){ apt-get install -y "$1" >/dev/null 2>&1 ;}
|
||||||
grepseq="\"^[PGU]*,\""
|
grepseq="\"^[PGU]*,\""
|
||||||
else
|
else
|
||||||
|
distro="arch"
|
||||||
installpkg(){ pacman --noconfirm --needed -S "$1" >/dev/null 2>&1 ;}
|
installpkg(){ pacman --noconfirm --needed -S "$1" >/dev/null 2>&1 ;}
|
||||||
grepseq="\"^[PGA]*,\""
|
grepseq="\"^[PGA]*,\""
|
||||||
fi
|
fi
|
||||||
|
@ -187,20 +188,23 @@ dialog --title "LARBS Installation" --infobox "Installing \`basedevel\` and \`gi
|
||||||
installpkg curl
|
installpkg curl
|
||||||
installpkg base-devel
|
installpkg base-devel
|
||||||
installpkg git
|
installpkg git
|
||||||
[ -f /etc/sudoers.pacnew ] && cp /etc/sudoers.pacnew /etc/sudoers # Just in case
|
|
||||||
|
|
||||||
# Allow user to run sudo without password. Since AUR programs must be installed
|
[ "$distro" = arch ] && { \
|
||||||
# in a fakeroot environment, this is required for all builds with AUR.
|
[ -f /etc/sudoers.pacnew ] && cp /etc/sudoers.pacnew /etc/sudoers # Just in case
|
||||||
newperms "%wheel ALL=(ALL) NOPASSWD: ALL"
|
|
||||||
|
|
||||||
# Make pacman and yay colorful and adds eye candy on the progress bar because why not.
|
# Allow user to run sudo without password. Since AUR programs must be installed
|
||||||
grep "^Color" /etc/pacman.conf >/dev/null || sed -i "s/^#Color$/Color/" /etc/pacman.conf
|
# in a fakeroot environment, this is required for all builds with AUR.
|
||||||
grep "ILoveCandy" /etc/pacman.conf >/dev/null || sed -i "/#VerbosePkgLists/a ILoveCandy" /etc/pacman.conf
|
newperms "%wheel ALL=(ALL) NOPASSWD: ALL"
|
||||||
|
|
||||||
# Use all cores for compilation.
|
# Make pacman and yay colorful and adds eye candy on the progress bar because why not.
|
||||||
sed -i "s/-j2/-j$(nproc)/;s/^#MAKEFLAGS/MAKEFLAGS/" /etc/makepkg.conf
|
grep "^Color" /etc/pacman.conf >/dev/null || sed -i "s/^#Color$/Color/" /etc/pacman.conf
|
||||||
|
grep "ILoveCandy" /etc/pacman.conf >/dev/null || sed -i "/#VerbosePkgLists/a ILoveCandy" /etc/pacman.conf
|
||||||
|
|
||||||
manualinstall $aurhelper || error "Failed to install AUR helper."
|
# Use all cores for compilation.
|
||||||
|
sed -i "s/-j2/-j$(nproc)/;s/^#MAKEFLAGS/MAKEFLAGS/" /etc/makepkg.conf
|
||||||
|
|
||||||
|
manualinstall $aurhelper || error "Failed to install AUR helper."
|
||||||
|
}
|
||||||
|
|
||||||
# The command that does all the installing. Reads the progs.csv file and
|
# 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
|
# installs each needed program the way required. Be sure to run this only after
|
||||||
|
@ -218,11 +222,6 @@ rm -f "/home/$name/README.md" "/home/$name/LICENSE"
|
||||||
# Most important command! Get rid of the beep!
|
# Most important command! Get rid of the beep!
|
||||||
systembeepoff
|
systembeepoff
|
||||||
|
|
||||||
# This line, overwriting the `newperms` command above will allow the user to run
|
|
||||||
# serveral important commands, `shutdown`, `reboot`, updating, etc. without a password.
|
|
||||||
newperms "%wheel ALL=(ALL) ALL #LARBS
|
|
||||||
%wheel ALL=(ALL) NOPASSWD: /usr/bin/shutdown,/usr/bin/reboot,/usr/bin/systemctl suspend,/usr/bin/wifi-menu,/usr/bin/mount,/usr/bin/umount,/usr/bin/pacman -Syu,/usr/bin/pacman -Syyu,/usr/bin/packer -Syu,/usr/bin/packer -Syyu,/usr/bin/systemctl restart NetworkManager,/usr/bin/rc-service NetworkManager restart,/usr/bin/pacman -Syyu --noconfirm,/usr/bin/loadkeys,/usr/bin/yay,/usr/bin/pacman -Syyuw --noconfirm"
|
|
||||||
|
|
||||||
# Make zsh the default shell for the user.
|
# Make zsh the default shell for the user.
|
||||||
sed -i "s/^$name:\(.*\):\/bin\/.*/$name:\1:\/bin\/zsh/" /etc/passwd
|
sed -i "s/^$name:\(.*\):\/bin\/.*/$name:\1:\/bin\/zsh/" /etc/passwd
|
||||||
|
|
||||||
|
@ -232,6 +231,11 @@ dbus-uuidgen > /var/lib/dbus/machine-id
|
||||||
# Let LARBS know the WM it's supposed to run.
|
# Let LARBS know the WM it's supposed to run.
|
||||||
echo "$edition" > "/home/$name/.local/share/larbs/wm"; chown -R "$name":wheel "/home/$name/.local"
|
echo "$edition" > "/home/$name/.local/share/larbs/wm"; chown -R "$name":wheel "/home/$name/.local"
|
||||||
|
|
||||||
|
# This line, overwriting the `newperms` command above will allow the user to run
|
||||||
|
# serveral important commands, `shutdown`, `reboot`, updating, etc. without a password.
|
||||||
|
[ "$distro" = arch ] && newperms "%wheel ALL=(ALL) ALL #LARBS
|
||||||
|
%wheel ALL=(ALL) NOPASSWD: /usr/bin/shutdown,/usr/bin/reboot,/usr/bin/systemctl suspend,/usr/bin/wifi-menu,/usr/bin/mount,/usr/bin/umount,/usr/bin/pacman -Syu,/usr/bin/pacman -Syyu,/usr/bin/packer -Syu,/usr/bin/packer -Syyu,/usr/bin/systemctl restart NetworkManager,/usr/bin/rc-service NetworkManager restart,/usr/bin/pacman -Syyu --noconfirm,/usr/bin/loadkeys,/usr/bin/yay,/usr/bin/pacman -Syyuw --noconfirm"
|
||||||
|
|
||||||
# Last message! Install complete!
|
# Last message! Install complete!
|
||||||
finalize
|
finalize
|
||||||
clear
|
clear
|
||||||
|
|
Loading…
Reference in a new issue