From 8512e4340535b1687ac3dda1ee7f941e90613c26 Mon Sep 17 00:00:00 2001 From: Kevin Kofler Date: Fri, 7 Nov 2014 03:04:18 +0100 Subject: [PATCH] displaymanager: Set Session= for sddm autologin. Detect the correct value using find_desktop_environment. --- src/modules/displaymanager/main.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/modules/displaymanager/main.py b/src/modules/displaymanager/main.py index 76d97041f..f788a64cb 100644 --- a/src/modules/displaymanager/main.py +++ b/src/modules/displaymanager/main.py @@ -171,6 +171,11 @@ def set_autologin(username, displaymanagers, root_mount_point): # User= line, possibly commented out if re.match('\\s*(?:#\\s*)?User=', line): line = 'User={}\n'.format(username) + # Session= line, commented out or with empty value + if re.match('\\s*#\\s*Session=|\\s*Session=$', line): + default_desktop_environment = find_desktop_environment(root_mount_point) + if default_desktop_environment != None: + line = 'Session={}.desktop\n'.format(default_desktop_environment.desktop_file) sddm_conf.write(line) return None