From 524bcc15eacc8425de7d5bd32c19e825cb2cf215 Mon Sep 17 00:00:00 2001 From: Kevin Kofler Date: Mon, 1 Dec 2014 03:01:39 +0100 Subject: [PATCH] displaymanager: Fix default session setup for GDM. The default session setting in GDM is per user. Therefore, it is not of much use to set it for the gdm user. (Nobody will log in as "gdm".) Unfortunately, there seems to be no systemwide setting for the default session, the AccountsService provides no such setting, and GDM just hardcodes the fallback to use if it is not set in the AccountsService. (GDM first tries "gnome", and if that is not available, it picks the first session in the alphabet.) Therefore, the best we can do right now is to set the default session for the autoLoginUser. This is the case where it matters the most anyway. We would also need the username of a non-autologin user in the global storage to do any better. --- src/modules/displaymanager/main.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/modules/displaymanager/main.py b/src/modules/displaymanager/main.py index 6b90e34a8..2168662c3 100644 --- a/src/modules/displaymanager/main.py +++ b/src/modules/displaymanager/main.py @@ -89,6 +89,14 @@ def set_autologin(username, displaymanagers, default_desktop_environment, root_m gdm_conf.write('[daemon]\n') gdm_conf.write('AutomaticLogin=%s\n' % username) gdm_conf.write('AutomaticLoginEnable=True\n') + if os.path.exists("%s/var/lib/AccountsService/users" % root_mount_point): + os.system( + "echo \"[User]\" > %s/var/lib/AccountsService/users/%s" % (root_mount_point, username)) + if default_desktop_environment != None: + os.system( + "echo \"XSession=%s\" >> %s/var/lib/AccountsService/users/%s" % (default_desktop_environment.desktop_file, root_mount_point, username)) + os.system( + "echo \"Icon=\" >> %s/var/lib/AccountsService/users/%s" % (root_mount_point, username)) if "kdm" in displaymanagers: # Systems with KDM as Desktop Manager @@ -256,14 +264,6 @@ def run(): libcalamares.utils.chroot_call(['passwd', '-l', 'gdm']) libcalamares.utils.chroot_call( ['chown', '-R', 'gdm:gdm', '/var/lib/gdm']) - if os.path.exists("%s/var/lib/AccountsService/users" % root_mount_point): - os.system( - "echo \"[User]\" > %s/var/lib/AccountsService/users/gdm" % root_mount_point) - if default_desktop_environment != None: - os.system( - "echo \"XSession=%s\" >> %s/var/lib/AccountsService/users/gdm" % (default_desktop_environment.desktop_file, root_mount_point)) - os.system( - "echo \"Icon=\" >> %s/var/lib/AccountsService/users/gdm" % root_mount_point) else: libcalamares.utils.debug("gdm selected but not installed") displaymanagers.remove("gdm")