no more json config
This commit is contained in:
parent
358968327d
commit
efd9e3de04
|
@ -7,10 +7,7 @@ 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":"<YOUR USERNAME HERE>"}
|
||||
```
|
||||
As of version 3 I will now try to guess the user.
|
||||
|
||||
lightdm.conf
|
||||
```
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue