[+] Add autologin [-] remove autostartdesktop

This commit is contained in:
Simon Rieger 2022-10-04 20:37:24 +02:00
parent baf07f5619
commit 6f7b8e874c

View file

@ -1223,10 +1223,6 @@ function abfrage() {
fi fi
echo "The desktop environments installed by default are sway (preconfigured) or CLI (only for CLI versions!!!)"
read -p "Which desktop environment should be started by default?? : [SWAY/i3/plasma/lxqt/gnome/xfce4/cli] " autostartdesktop
[[ -z "${autostartdesktop}" ]] && autostartdesktop="sway"
read -p "Should you autologin in youre System? : [Y/n] " autologin read -p "Should you autologin in youre System? : [Y/n] " autologin
[[ -z "${autologin}" ]] && autologin=y [[ -z "${autologin}" ]] && autologin=y
@ -1588,7 +1584,14 @@ cp /opt/${repo}/configs/config.fish ${mountpoint}/root/.config/fish/config.fish
touch ${mountpoint}/root/.bash_profile touch ${mountpoint}/root/.bash_profile
touch ${mountpoint}/home/"${user}"/.bash_profile touch ${mountpoint}/home/"${user}"/.bash_profile
mkdir -p ${mountpoint}/etc/X11/xinit/ if [ ${autologin} != "n" ]; then
mkdir -p ${mountpoint}/etc/systemd/system/getty\@tty1.service.d/
echo "[Service]" > ${mountpoint}/etc/systemd/system/getty\@tty1.service.d/autologin.conf
echo "ExecStart=" >> ${mountpoint}/etc/systemd/system/getty\@tty1.service.d/autologin.conf
echo "ExecStart=-/usr/bin/agetty --autologin ${user} -s %I 115200,38400,9600 vt102" >> ${mountpoint}/etc/systemd/system/getty\@tty1.service.d/autologin.conf
else
rm ${mountpoint}/etc/systemd/system/getty\@tty1.service.d/autologin.conf
fi
if [ -f "/etc/locale.conf" ]; then cp /etc/locale.conf ${mountpoint}/etc/locale.conf; fi if [ -f "/etc/locale.conf" ]; then cp /etc/locale.conf ${mountpoint}/etc/locale.conf; fi
if [ -f "/etc/vconsole.conf" ]; then cp /etc/vconsole.conf ${mountpoint}/etc/vconsole.conf; fi if [ -f "/etc/vconsole.conf" ]; then cp /etc/vconsole.conf ${mountpoint}/etc/vconsole.conf; fi