deflogin: set default session for lightdm autologin-session

This commit is contained in:
Anton Midyukov 2023-07-13 14:50:02 +07:00
parent 7ce989c1c4
commit f5a7699407

View File

@ -1,8 +1,7 @@
#!/bin/sh
account_dir=/var/lib/AccountsService/users
[ -d /var/lib/AccountsService/users ] || exit 0
[ -n "$GLOBAL_USERS" ] || exit 0
[ -n "$GLOBAL_DEFAULT_SESSION" ] || exit 0
@ -15,6 +14,12 @@ else
exit 1
fi
LIGHTDM_CONF=/etc/lightdm/lightdm.conf.d/autologin.conf
[ ! -s "$LIGHTDM_CONF" ] ||
sed -i "s/autologin-session=.*/autologin-session=$GLOBAL_DEFAULT_SESSION/" "$LIGHTDM_CONF"
account_dir=/var/lib/AccountsService/users
[ -d /var/lib/AccountsService/users ] || exit 0
for user in $GLOBAL_USERS; do
user="${user%%:*}"
cat > "$account_dir"/"$user"<<-EOF