Minor cleanup

This commit is contained in:
natemaia 2019-09-09 20:27:10 -07:00
parent 2b949499ba
commit 9dea6c7dd9

View File

@ -1500,7 +1500,17 @@ install_user()
chrun "chpasswd <<< '$NEWUSER:$USER_PASS'" 2>$ERR
errshow 1 "set $NEWUSER password"
[[ $INSTALL_WMS == *dwm* ]] && install_suckless
if [[ $INSTALL_WMS == *dwm* ]];then
mkdir -pv "$mnt/home/$newuser/suckless"
for i in dwm dmenu st; do
if chrun "git clone https://git.suckless.org/$i /home/$newuser/suckless/$i"; then
chrun "cd /home/$newuser/suckless/$i; make prefix=/usr install; make clean; rm config.h"
else
printf "failed to clone %s repo\n" "$i"
fi
done
fi
[[ $WM_PKGS == *xfce* ]] && echo 'volumeicon &' >> $MNT/home/$NEWUSER/.xprofile
# remove some commands from ~/.xprofile when using KDE or Gnome as the login session
@ -1613,19 +1623,6 @@ install_packages()
return 0
}
install_suckless()
{
mkdir -pv "$MNT/home/$NEWUSER/suckless"
for i in dwm dmenu st; do
if chrun "git clone https://git.suckless.org/$i /home/$NEWUSER/suckless/$i"; then
chrun "cd /home/$NEWUSER/suckless/$i; make PREFIX=/usr install; make clean; rm config.h"
else
printf "failed to clone %s repo\n" "$i"
fi
done
}
install_mkinitcpio()
{
local add=''
@ -1638,10 +1635,8 @@ install_mkinitcpio()
install_mirrorlist()
{
local mfile="$1" # output mirrorlist file
if hash reflector >/dev/null 2>&1; then
reflector --verbose --score 80 -l 40 -f 5 --sort rate --save "$mfile"
reflector --verbose --score 80 -l 40 -f 5 --sort rate --save "$1"
elif hash rankmirrors >/dev/null 2>&1; then
echo "Sorting mirrorlist"
local key="access_key=5f29642060ab983b31fdf4c2935d8c56"
@ -1660,7 +1655,7 @@ install_mirrorlist()
else # no country code so just grab all mirrors, will be a very slow sort but we don't have other options
mirror="https://www.archlinux.org/mirrorlist/?country=all&use_mirror_status=on"
fi
curl -fsSL "$mirror" | sed -e 's/^#Server/Server/' -e '/^#/d' | rankmirrors -n 6 - >"$mfile"
curl -fsSL "$mirror" | sed -e 's/^#Server/Server/' -e '/^#/d' | rankmirrors -n 6 - >"$1"
fi
return 0
@ -1754,9 +1749,10 @@ setup_syslinux()
prerun_syslinux()
{
local c="$MNT/boot/syslinux" s="/usr/lib/syslinux/bios" d=".."
[[ $SYS == 'UEFI' ]] && { c="$MNT/boot/EFI/syslinux"; s="/usr/lib/syslinux/efi64/"; d=''; }
[[ $SYS == 'UEFI' ]] && { c="$MNT/boot/EFI/syslinux"; s="/usr/lib/syslinux/efi64"; d=''; }
mkdir -pv "$c" && cp -rfv $s/* "$c/"
mkdir -pv "$c"
cp -rfv "$s/"* "$c/"
cat > "$c/syslinux.cfg" <<- EOF
UI menu.c32
PROMPT 0