Merge pull request #758 from manjaro/lightdm-greeters

[displaymanager] check for installed lightdm greeter and configure accordingly
main
Philip Müller 8 years ago committed by GitHub
commit f64266a294

@ -3,10 +3,11 @@
# #
# === This file is part of Calamares - <http://github.com/calamares> === # === This file is part of Calamares - <http://github.com/calamares> ===
# #
# Copyright 2014-2016, Philip Müller <philm@manjaro.org> # Copyright 2014-2017, Philip Müller <philm@manjaro.org>
# Copyright 2014-2015, Teo Mrnjavac <teo@kde.org> # Copyright 2014-2015, Teo Mrnjavac <teo@kde.org>
# Copyright 2014, Kevin Kofler <kevin.kofler@chello.at> # Copyright 2014, Kevin Kofler <kevin.kofler@chello.at>
# Copyright 2017, Alf Gaida <agaida@siduction.org> # Copyright 2017, Alf Gaida <agaida@siduction.org>
# Copyright 2017, Bernhard Landauer <oberon@manjaro.org>
# #
# Calamares is free software: you can redistribute it and/or modify # Calamares is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@ -403,6 +404,10 @@ def run():
# setup lightdm # setup lightdm
if "lightdm" in displaymanagers: if "lightdm" in displaymanagers:
if have_dm("lightdm", root_mount_point): if have_dm("lightdm", root_mount_point):
lightdm_conf_path = os.path.join(
root_mount_point, "etc/lightdm/lightdm.conf"
)
if enable_basic_setup: if enable_basic_setup:
libcalamares.utils.target_env_call( libcalamares.utils.target_env_call(
['mkdir', '-p', '/run/lightdm'] ['mkdir', '-p', '/run/lightdm']
@ -440,21 +445,42 @@ def run():
if default_desktop_environment is not None: if default_desktop_environment is not None:
os.system( os.system(
"sed -i -e \"s/^.*user-session=.*/user-session={!s}/\" " "sed -i -e \"s/^.*user-session=.*/user-session={!s}/\" "
"{!s}/etc/lightdm/lightdm.conf".format( "{!s}".format(
default_desktop_environment.desktop_file, default_desktop_environment.desktop_file,
root_mount_point lightdm_conf_path
) )
) )
if default_desktop_environment.desktop_file == "deepin": # configure lightdm-greeter
os.system( greeter_path = os.path.join(
"sed -i -e \"s/^.greeter-session=.*" root_mount_point, "usr/share/xgreeters"
"/greeter-session=lightdm-deepin-greeter/\" " )
"{!s}/etc/lightdm/lightdm.conf".format(
root_mount_point
)
)
if (os.path.exists(greeter_path)):
greeter_configured = False
# configure first found lightdm-greeter
for entry in os.scandir(greeter_path):
if entry.name.endswith('.desktop') \
and not greeter_configured:
greeter = entry.name.split('.')[0]
libcalamares.utils.debug(
"found greeter {!s}".format(greeter)
)
os.system(
"sed -i -e \"s/^.*greeter-session=.*"
"/greeter-session={!s}/\" {!s}".format(
greeter,
lightdm_conf_path
)
)
libcalamares.utils.debug(
"{!s} configured as greeter.".format(greeter)
)
greeter_configured = True
if not greeter_configured:
return ("No lightdm greeter installed.")
else: else:
libcalamares.utils.debug("lightdm selected but not installed") libcalamares.utils.debug("lightdm selected but not installed")
displaymanagers.remove("lightdm") displaymanagers.remove("lightdm")

Loading…
Cancel
Save