Commit dc9b7066 authored by Michael Shigorin's avatar Michael Shigorin

features.in/live: implemented lightdm autologin

The main part is done as per https://wiki.archlinux.org/index.php/LightDM#Enable_Autologin; there's an issue that the lightdm developer insist that autologin user belongs to "nopasswdlogin" group though.
parent 50c27a17
#!/bin/sh
#!/bin/sh -x
# * reset password for root
# * add user `altlinux' (without password)
NPG="nopasswdlogin"
GRPLIST="users scanner audio radio proc cdrom cdwriter wheel fuse $NPG"
verbose()
{
if [ -n "$GLOBAL_VERBOSE" ]; then
......@@ -12,8 +15,9 @@ verbose()
add_user()
{
verbose "Add $1 user"
groupadd -r "$NPG"
local groups=
for g in users scanner audio radio proc cdrom cdwriter wheel fuse; do
for g in $GRPLIST; do
if groupmod $g 2>/dev/null; then
if [ -n "$groups" ]; then
groups="$groups,$g"
......
......@@ -22,6 +22,15 @@ AUTOLOGIN=yes
E_O_F
fi
# lightdm autologin
LIGHTDM_CONF=/etc/lightdm/lightdm.conf
if [ -f "$LIGHTDM_CONF" ]; then
sed -i \
-e "s/^#\(autologin-user=\).*$/\1$USER/" \
-e "s/^#\(autologin-user-timeout=0\)/\1/" \
"$LIGHTDM_CONF"
fi
# gdm2 autologin
GDM_CONF=/etc/X11/gdm/custom.conf
if [ -f "$GDM_CONF" ]; then
......
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