4 _set_gdm_auto_login() {
7 if [ ! -e $gdm_conf ]; then
8 echo "I: No config file $gdm_conf GNOME $gnome_ver found"
9 elif [ -z "$(grep 'AutomaticLogin=brain' $gdm_conf)" ]; then
10 echo "I: Enabling autologin of user 'brain' for GNOME $gnome_ver."
11 sed -i -e 's/^\[daemon\]$/\[daemon\]\nAutomaticLoginEnable=true\nAutomaticLogin=brain\n/' $gdm_conf
12 # update gconf defaults tree
18 _set_lightdm_auto_login() {
20 if [ ! -e $lightdm_conf ]; then
21 echo "I: No config file $lightdm_conf found"
22 elif [ ! -z "$(grep '^# *autologin-user=' $lightdm_conf)" ]; then
23 echo "I: Enabling autologin of user 'brain' for lightdm."
24 sed -i -e 's/^# *autologin-user=.*$/autologin-user=brain/' $lightdm_conf
29 gdm_conf=/etc/gdm/gdm.conf
30 if [ "$1" = "configure" -o "$1" = "abort-upgrade" ]; then
32 [ -e /etc/gdm/gdm.conf ] && _set_gdm_auto_login /etc/gdm/gdm.conf 2
33 [ -e /etc/gdm3/daemon.conf ] && _set_gdm_auto_login /etc/gdm3/daemon.conf 3
35 [ -e /etc/lightdm/lightdm.conf ] && _set_lightdm_auto_login /etc/lightdm/lightdm.conf