Skip to content

Commit

Permalink
login from cli added.
Browse files Browse the repository at this point in the history
  • Loading branch information
sulincix committed May 6, 2024
1 parent b072846 commit 6ef5108
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/module/daemon.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import json
@asynchronous
def module_init():
if not get("enabled",True,"daemon"):
return
busdir = "/var/lib/lightdm/"
while True:
if os.path.exists("/{}/pardus-greeter".format(busdir)):
os.unlink("/{}/pardus-greeter".format(busdir))
os.mkfifo("/{}/pardus-greeter".format(busdir))
f = open("/{}/pardus-greeter".format(busdir),"r")
username=""
password=""
data=json.loads(f.read())
if "username" in data:
username=data["username"]
if "password" in data:
password = data["password"]
if "session" in data:
lightdm.set(session = data["session"])
loginwindow.o("ui_entry_username").set_text(username)
loginwindow.o("ui_entry_password").set_text(password)
lightdm.set(username, password)
lightdm.login()

0 comments on commit 6ef5108

Please sign in to comment.