[displaymanager] Fix greetd commands

- since default_desktop_environment isn't a string, need
  to pick the string -- the command -- out of the object first.
This commit is contained in:
Adriaan de Groot 2021-11-15 13:38:46 +01:00
parent 16a029abd2
commit 5f7b221e11

View File

@ -903,18 +903,19 @@ class DMgreetd(DisplayManager):
def set_autologin(self, username, do_autologin, default_desktop_environment):
self.config_load()
de_command = default_desktop_environment.executable
if os.path.exists(self.os_path("usr/bin/gtkgreed")) and os.path.exists(self.os_path("usr/bin/cage")):
self.config_data['default_session']['command'] = "cage -s -- gtkgreet"
elif os.path.exists(self.os_path("usr/bin/tuigreet")):
tuigreet_base_cmd = "tuigreet --remember --time --issue --asterisks --cmd "
self.config_data['default_session']['command'] = tuigreet_base_cmd + default_desktop_environment
self.config_data['default_session']['command'] = tuigreet_base_cmd + de_command
elif os.path.exists(self.os_path("usr/bin/ddlm")):
self.config_data['default_session']['command'] = "ddlm --target " + default_desktop_environment
self.config_data['default_session']['command'] = "ddlm --target " + de_command
else:
self.config_data['default_session']['command'] = "agreety --cmd " + default_desktop_environment
self.config_data['default_session']['command'] = "agreety --cmd " + de_command
if do_autologin == True:
self.config_data['initial_session'] = dict(command = default_desktop_environment, user = username)
self.config_data['initial_session'] = dict(command = de_command, user = username)
self.config_write()