diff --git a/src/modules/displaymanager/displaymanager.conf b/src/modules/displaymanager/displaymanager.conf index 59ad061dc..1c30ed637 100644 --- a/src/modules/displaymanager/displaymanager.conf +++ b/src/modules/displaymanager/displaymanager.conf @@ -20,3 +20,7 @@ displaymanagers: #display manager are set up correctly. This is normally done by the distribution #packages, and best left to them. Therefore, it is disabled by default. basicSetup: false + +#If true, setup autologin for openSUSE. This only makes sense on openSUSE +#derivatives or other systems where /etc/sysconfig/displaymanager exists. +sysconfigSetup: false diff --git a/src/modules/displaymanager/main.py b/src/modules/displaymanager/main.py index d8a635eff..03edbbd5c 100644 --- a/src/modules/displaymanager/main.py +++ b/src/modules/displaymanager/main.py @@ -355,6 +355,18 @@ def set_autologin(username, with open(sddm_conf_path, 'w') as sddm_config_file: sddm_config.write(sddm_config_file, space_around_delimiters=False) + if "sysconfig" == displaymanager: + dmauto = "DISPLAYMANAGER_AUTOLOGIN" + + os.system( + "sed -i -e 's|^{!s}=.*|{!s}=\"{!s}\"|' " + "{!s}/etc/sysconfig/displaymanager".format( + dmauto, dmauto, + username if do_autologin else "", + root_mount_point + ) + ) + return None @@ -662,6 +674,11 @@ def run(): ) if dm_message is not None: dm_setup_message.append("{!s}: {!s}".format(*dm_message)) + + if ("sysconfigSetup" in libcalamares.job.configuration + and libcalamares.job.configuration["sysconfigSetup"]): + set_autologin(username, "sysconfig", None, root_mount_point) + if dm_setup_message: return ("Display manager configuration was incomplete", "\n".join(dm_setup_message))