File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
modules/lightdm/airootfs.any
etc/lightdm/lightdm.conf.d Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 1+ [Seat:*]
2+ autologin-session=%SESSION%
Original file line number Diff line number Diff line change 1717
1818# Replace auto login user
1919sed -i " s|%USERNAME%|${username} |g" " /etc/lightdm/lightdm.conf.d/02-autologin.conf"
20+
21+
22+ # Session list
23+ if cat " /etc/lightdm/lightdm.conf.d/02-autologin-session.conf" | grep " %SESSION%" 1> /dev/null 2>&1 ; then
24+ session_list=()
25+ while read -r session; do
26+ session_list+=(" ${session} " )
27+ done < <( find " /usr/share/xsessions" -type f -print0 -name " *.desktop" | xargs -0 -I{} bash -c ' basename {} | sed "s|.desktop||g"' )
28+
29+ if (( "${# session_list[@]} " = 1 )) ; then
30+ session=" ${session_list[*]} "
31+ sed -i " s|%SESSION%|${session} |g" " /etc/lightdm/lightdm.conf.d/02-autologin-session.conf"
32+ elif (( "${# session_list[@]} " = 0 )) ; then
33+ echo " Warining: Auto login session was not found"
34+ else
35+ remove " /etc/lightdm/lightdm.conf.d/02-autologin-session.conf"
36+ fi
37+ fi
You can’t perform that action at this time.
0 commit comments