From 869a6a6ee77c50d82db1349946045fcef7fd6ed0 Mon Sep 17 00:00:00 2001 From: natemaia Date: Wed, 13 Nov 2019 19:47:53 -0800 Subject: [PATCH] Remove root autologin when no login type is chosen --- archlabs-installer | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/archlabs-installer b/archlabs-installer index 0814f01..ce53952 100755 --- a/archlabs-installer +++ b/archlabs-installer @@ -1370,9 +1370,10 @@ install_user() 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 @@ -1390,6 +1391,7 @@ install_login() ${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 @@ -1397,15 +1399,18 @@ install_login() 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 }