Merge pull request #134 from calamares/sddm

Generate sddm.conf if not present.
This commit is contained in:
Teo Mrnjavac 2014-11-04 09:51:36 +01:00
commit 486f160ca9

View File

@ -135,8 +135,11 @@ def set_autologin(username, displaymanagers, root_mount_point):
if "sddm" in displaymanagers:
# Systems with Sddm as Desktop Manager
sddm_conf_path = os.path.join(root_mount_point, "etc/sddm.conf")
if os.path.isfile(sddm_conf_path):
print('SDDM config file exists')
else:
check_chroot_call("sddm --example-config > etc/sddm.conf", shell=True)
text = []
if os.path.exists(sddm_conf_path):
with open(sddm_conf_path, 'r') as sddm_conf:
text = sddm_conf.readlines()
with open(sddm_conf_path, 'w') as sddm_conf:
@ -144,8 +147,6 @@ def set_autologin(username, displaymanagers, root_mount_point):
if 'User=' in line:
line = 'User={}\n'.format(username)
sddm_conf.write(line)
else:
return "Cannot write SDDM configuration file", "SDDM config file %s does not exist" % sddm_conf_path
return None