From 662656a76222e8375c91ac08cd5be0f6c3d179bf Mon Sep 17 00:00:00 2001 From: Rohan Garg Date: Mon, 31 Oct 2016 17:47:59 +0100 Subject: [PATCH] Better handling for when the Autologin section already has things --- src/modules/displaymanager/main.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/modules/displaymanager/main.py b/src/modules/displaymanager/main.py index 4a645a7ca..2b7c6b6cc 100644 --- a/src/modules/displaymanager/main.py +++ b/src/modules/displaymanager/main.py @@ -262,9 +262,15 @@ def set_autologin(username, displaymanagers, default_desktop_environment, root_m sddm_config.read(sddm_conf_path) if do_autologin: - sddm_config['Autologin'] = { 'User': username } - with open(sddm_conf_path, 'w') as sddm_config_file: - sddm_config.write(sddm_config_file, space_around_delimiters=False) + username_hash = {'User': username} + if sddm_config['Autologin']: + sddm_config['Autologin'].update(username_hash) + else: + sddm_config['Autologin'] = username_hash + + with open(sddm_conf_path, 'w') as sddm_config_file: + sddm_config.write(sddm_config_file, space_around_delimiters=False) + return None