Merge pull request #134 from calamares/sddm
Generate sddm.conf if not present.
This commit is contained in:
commit
486f160ca9
@ -135,18 +135,19 @@ 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")
|
||||
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:
|
||||
for line in text:
|
||||
if 'User=' in line:
|
||||
line = 'User={}\n'.format(username)
|
||||
sddm_conf.write(line)
|
||||
if os.path.isfile(sddm_conf_path):
|
||||
print('SDDM config file exists')
|
||||
else:
|
||||
return "Cannot write SDDM configuration file", "SDDM config file %s does not exist" % sddm_conf_path
|
||||
|
||||
check_chroot_call("sddm --example-config > etc/sddm.conf", shell=True)
|
||||
text = []
|
||||
with open(sddm_conf_path, 'r') as sddm_conf:
|
||||
text = sddm_conf.readlines()
|
||||
with open(sddm_conf_path, 'w') as sddm_conf:
|
||||
for line in text:
|
||||
if 'User=' in line:
|
||||
line = 'User={}\n'.format(username)
|
||||
sddm_conf.write(line)
|
||||
|
||||
return None
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user