Skip to content

Commit

Permalink
typo fix and remove fifo in login handler
Browse files Browse the repository at this point in the history
  • Loading branch information
sulincix committed Jun 11, 2024
1 parent 61fc93a commit 0c4d858
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/module/daemon.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
import json
@asynchronous
def module_init():
busdir = "/var/lib/lightdm/"
if os.path.exists("/{}/pardus-greeter".format(busdir)):
os.unlink("/{}/pardus-greeter".format(busdir))
if not get("enabled",True,"daemon"):
return
busdir = "/var/lib/lightdm/"
while True:
os.mkfifo("/{}/pardus-greeter".format(busdir))
try:
with open("/{}/pardus-greeter".format(busdir),"r") as f:
username=""
password=""
data=json.loads(f.read())
os.unlink("/{}/pardus-greeter".format(busdir))
if "username" in data:
username=str(data["username"])
if "password" in data:
Expand All @@ -24,5 +25,6 @@ def module_init():
lightdm.set(username, password)
lightdm.login()
except Exception as e:
if os.path.exists("/{}/pardus-greeter".format(busdir)):
os.unlink("/{}/pardus-greeter".format(busdir))
print(traceback.format_exc(), file=sys.stderr)
os.unlink("/{}/pardus-greeter".format(busdir))
4 changes: 4 additions & 0 deletions src/module/gtkwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ def login_handler(self):
gsettings_set("last-username", lightdm.get_username())
gsettings_set("last-session", lightdm.get_session())

busdir = "/var/lib/lightdm/"
if os.path.exists("/{}/pardus-greeter".format(busdir)):
os.unlink("/{}/pardus-greeter".format(busdir))

self.kill_windowmanager()


Expand Down

0 comments on commit 0c4d858

Please sign in to comment.