Commit 5b7c1893 authored by Andrey Cherepanov's avatar Andrey Cherepanov Committed by Michael Shigorin

x11-autologin: detect default lightdm session

parent 7755845d
......@@ -55,9 +55,11 @@ fi
LIGHTDM_CONF=/etc/lightdm/lightdm.conf
if [ -f "$LIGHTDM_CONF" ]; then
backup "$LIGHTDM_CONF"
default_session="$(ls -1 /usr/share/xsessions/*.desktop | sed -n 's/^.*\/\([^/]\+\)\.desktop$/\1/;1p')"
sed -i \
-e "s/^#\(autologin-user=\).*$/\1$USER/" \
-e "s/^#\(autologin-user-timeout=0\)/\1/" \
-e "s/^#(autologin-session=).*$/\1$default_session/" \
"$LIGHTDM_CONF"
backup "/etc/group"
add_nopasswdlogin_group lightdm ||:
......
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