+elif [ -f /root/etc/kde4/kdm/kdmrc ]
+then
+ # Configure KDM-KDE4 autologin
+ sed -i -r -e "s/^#?AutoLoginEnable=.*\$/AutoLoginEnable=true/" \
+ -e "s/^#?AutoLoginUser=.*\$/AutoLoginUser=$USERNAME/" \
+ -e "s/^#?AutoReLogin=.*\$/AutoReLogin=true/" \
+ /root/etc/kde4/kdm/kdmrc
+fi
+
+if [ -f /root/etc/lxdm/lxdm.conf ]
+then
+ # Configure LXDM autologin
+ sed -i -r -e "s/^# autologin=dgod/autologin=$USERNAME/" \
+ -e "s/^# session/session/" \
+ /root/etc/lxdm/lxdm.conf