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.
This commit is contained in:
parent
5e14080891
commit
524bcc15ea
@ -89,6 +89,14 @@ def set_autologin(username, displaymanagers, default_desktop_environment, root_m
|
|||||||
gdm_conf.write('[daemon]\n')
|
gdm_conf.write('[daemon]\n')
|
||||||
gdm_conf.write('AutomaticLogin=%s\n' % username)
|
gdm_conf.write('AutomaticLogin=%s\n' % username)
|
||||||
gdm_conf.write('AutomaticLoginEnable=True\n')
|
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:
|
if "kdm" in displaymanagers:
|
||||||
# Systems with KDM as Desktop Manager
|
# Systems with KDM as Desktop Manager
|
||||||
@ -256,14 +264,6 @@ def run():
|
|||||||
libcalamares.utils.chroot_call(['passwd', '-l', 'gdm'])
|
libcalamares.utils.chroot_call(['passwd', '-l', 'gdm'])
|
||||||
libcalamares.utils.chroot_call(
|
libcalamares.utils.chroot_call(
|
||||||
['chown', '-R', 'gdm:gdm', '/var/lib/gdm'])
|
['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:
|
else:
|
||||||
libcalamares.utils.debug("gdm selected but not installed")
|
libcalamares.utils.debug("gdm selected but not installed")
|
||||||
displaymanagers.remove("gdm")
|
displaymanagers.remove("gdm")
|
||||||
|
Loading…
Reference in New Issue
Block a user