mirror of
https://github.com/parchlinux/calamares.git
synced 2025-02-23 18:35:44 -05:00
displaymanager: Use a regex to match User= in sddm.conf.
This ensures we really only match the User= line and not the RememberLastUser= one.
This commit is contained in:
parent
e365864c05
commit
467d78dde6
1 changed files with 3 additions and 1 deletions
|
@ -20,6 +20,7 @@
|
|||
|
||||
import os
|
||||
import collections
|
||||
import re
|
||||
import libcalamares
|
||||
import subprocess
|
||||
|
||||
|
@ -167,7 +168,8 @@ def set_autologin(username, displaymanagers, root_mount_point):
|
|||
text = sddm_conf.readlines()
|
||||
with open(sddm_conf_path, 'w') as sddm_conf:
|
||||
for line in text:
|
||||
if 'User=' in line:
|
||||
# User= line, possibly commented out
|
||||
if re.match('\\s*(?:#\\s*)?User=', line):
|
||||
line = 'User={}\n'.format(username)
|
||||
sddm_conf.write(line)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue