From efd9e3de046ca82567969902708e9cbc9974e400 Mon Sep 17 00:00:00 2001 From: Raatty Date: Tue, 21 Apr 2020 17:51:00 +1200 Subject: [PATCH] no more json config --- README.md | 7 ++----- lightdm-mobile-greeter.py | 14 +++----------- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index e24ce34..f34a155 100644 --- a/README.md +++ b/README.md @@ -7,13 +7,10 @@ A simple log in screen for use on touch screens, designed for use on postmarketO make install ``` ## Configuring -/etc/lightdm_mobile_greeter.json -```json -{"user":""} -``` +As of version 3 I will now try to guess the user. lightdm.conf ``` greeter-session=lightdm-mobile-greeter user-session= -``` \ No newline at end of file +``` diff --git a/lightdm-mobile-greeter.py b/lightdm-mobile-greeter.py index 2b2dca0..0c6d796 100644 --- a/lightdm-mobile-greeter.py +++ b/lightdm-mobile-greeter.py @@ -1,14 +1,6 @@ #!/usr/bin/python3 import gi from gi.repository import Gtk, Gdk, Handy, LightDM -import json - - -class Config: - def __init__(self): - with open("/etc/lightdm_mobile_greeter.json") as f: - j = json.load(f) - self.user = j["user"] class Handler: @@ -24,8 +16,8 @@ class Handler: vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, visible=True) self.de_select.add(vbox) self.greeter.connect_sync() - self.conf = Config() - self.greeter.authenticate(self.conf.user) + self.user = LightDM.UserList.get_instance().get_users()[0].get_name() + self.greeter.authenticate(self.user) self.session = self.greeter.get_default_session_hint() sessions = iter([(s.get_name(), s.get_key()) for s in LightDM.get_sessions()]) name, key = sessions.__next__() @@ -60,7 +52,7 @@ class Handler: if greeter.get_is_authenticated(): greeter.start_session_sync(self.session) else: - greeter.authenticate(self.conf.user) + greeter.authenticate(self.user) def show_msg(self, greeter, text, type): self.msg_label.set_text(text)