install_login()
{
local serv="$MNT/etc/systemd/system/getty@tty1.service.d"
- echo "Setting up $LOGIN_TYPE"
+
case $LOGIN_TYPE in
ly|sddm|gdm|lightdm)
+ echo "Setting up $LOGIN_TYPE"
if [[ $LOGIN_WM == *dwm* ]]; then # dwm doesn't include an xsession file for display managers
mkdir -p "$MNT/usr/share/xsessions"
cat > "$MNT/usr/share/xsessions/dwm.desktop" <<- EOF
${LOGIN_TYPE}_config
;;
xinit)
+ echo "Setting up $LOGIN_TYPE"
if [[ $INSTALL_WMS ]]; then
sed -i "/exec/ c exec ${LOGIN_WM}" "$MNT/home/$NEWUSER/.xinitrc"
elif [[ -e $MNT/home/$NEWUSER/.xinitrc ]]; then
return 0
fi
if [[ $AUTOLOGIN ]]; then
- sed -i "s/root/${NEWUSER}/g" $serv/autologin.conf
+ sed -i "s/root/${NEWUSER}/g" "$serv/autologin.conf"
cat > "$MNT/home/$NEWUSER/$LOGINRC" <<- EOF
# automatically run startx when logging in on tty1
[ \$XDG_VTNR -eq 1 ] && exec startx
EOF
else
- rm -rf $serv
+ rm -rf "$serv"
fi
;;
+ *)
+ rm -rf "$serv"
+ ;;
esac
}