Skip to content

Commit

Permalink
more backtrace
Browse files Browse the repository at this point in the history
  • Loading branch information
nwg-piotr committed Dec 22, 2023
1 parent 42ec21e commit 4a75f0e
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions nwg_hello/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,14 @@ def login(self, btn):
# this file belongs to the 'greeter' user
save_json(cache, "/var/cache/nwg-hello/cache.json")

if cmd in self.x_sessions:
jreq = {"type": "start_session", "cmd": ["startx", "/usr/bin/env"] + cmd.split(),
"env": self.settings["env-vars"]}
else:
jreq = {"type": "start_session", "cmd": cmd.split(), "env": self.settings["env-vars"]}
try:
if cmd in self.x_sessions:
jreq = {"type": "start_session", "cmd": ["startx", "/usr/bin/env"] + cmd.split(),
"env": self.settings["env-vars"]}
else:
jreq = {"type": "start_session", "cmd": cmd.split(), "env": self.settings["env-vars"]}
except Exception as e:
eprint(f"Couldn't start session: {e}", log=self.log)

resp = greetd(self.client, jreq, log=self.log)
if "type" in resp and resp["type"] == "success":
Expand Down

0 comments on commit 4a75f0e

Please sign in to comment.