mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-30 02:45:37 -04:00
LightDM: if lightdm.conf doesn't exist (for autologin), create it
FIXES #568
This commit is contained in:
parent
39f6d0e2f5
commit
984a83deb9
1 changed files with 16 additions and 5 deletions
|
@ -281,12 +281,23 @@ def set_autologin(username,
|
||||||
|
|
||||||
lightdm_conf.write(line)
|
lightdm_conf.write(line)
|
||||||
else:
|
else:
|
||||||
return (
|
try:
|
||||||
"Cannot write LightDM configuration file",
|
# Create a new lightdm.conf file; this is documented to be
|
||||||
"LightDM config file {!s} does not exist".format(
|
# read last, after aeverything in lightdm.conf.d/
|
||||||
lightdm_conf_path
|
with open(lightdm_conf_path, 'w') as lightdm_conf:
|
||||||
|
if do_autologin:
|
||||||
|
lightdm_conf.write(
|
||||||
|
"autologin-user={!s}\n".format(username))
|
||||||
|
else:
|
||||||
|
lightdm_conf.write(
|
||||||
|
"#autologin-user=\n")
|
||||||
|
except FileNotFOundError:
|
||||||
|
return (
|
||||||
|
"Cannot write LightDM configuration file",
|
||||||
|
"LightDM config file {!s} does not exist".format(
|
||||||
|
lightdm_conf_path
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
|
||||||
|
|
||||||
if "slim" == displaymanager:
|
if "slim" == displaymanager:
|
||||||
# Systems with Slim as Desktop Manager
|
# Systems with Slim as Desktop Manager
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue