Commit 5a2059a1 authored by Anton Midyukov's avatar Anton Midyukov

deflogin: add variable DEFAULT_SESSION (for AccountsService)

parent 659bee91
......@@ -8,6 +8,7 @@ use/deflogin:
@$(call xport,GROUPS)
@$(call xport,SPEC_USER)
@$(call xport,LIVE_USER)
@$(call xport,DEFAULT_SESSION)
# some presets
# USERS variable chunk format is "login:passwd:admin:sudo"
......
#!/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
if [ -f /usr/share/wayland-sessions/"$GLOBAL_DEFAULT_SESSION".desktop ]; then
sesion_type=Session
elif [ -f /usr/share/xsessions/"$GLOBAL_DEFAULT_SESSION".desktop ]; then
sesion_type=XSession
else
echo "$GLOBAL_DEFAULT_SESSION.desktop is not found" >&2
exit 1
fi
for user in $GLOBAL_USERS; do
user="${user%%:*}"
cat > "$account_dir"/"$user"<<-EOF
[User]
$sesion_type=$GLOBAL_DEFAULT_SESSION
EOF
cat "$account_dir"/"$user"
done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment