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
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=''
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"
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
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