Ejemplo n.º 1
0
    def __init__(self, **kwargs):
        super(GreeterApp, self).__init__(**kwargs)
        self.password = ""
        self.session = ""
        
        # Connect to lightDM
        install_gobject_iteration()
        self.greeter = LightDM.Greeter()
        self.greeter.connect("authentication-complete", self.authentication_complete_cb)
        self.greeter.connect("show-prompt", self.show_prompt_cb)
        self.greeter.connect_sync()
        
        # Get all available sessions
        available_sessions = []
        for sess in LightDM.get_sessions():
            available_sessions.append(LightDM.Session.get_key(sess))
        
        # Get all available users
        available_users = []
        inst = LightDM.UserList.get_instance()
        for user in LightDM.UserList.get_users(inst):
            user_name = LightDM.User.get_name(user)
            available_users.append(user_name)

        self.root_widget = Builder.load_string(kv)
        self.root_widget.username_spinner.values = available_users
        self.root_widget.session_spinner.values = available_sessions
Ejemplo n.º 2
0
def authentication_complete_cb(greeter):
    logger.info('AUTH COMPLETE!')
    NOTE.set("Auth complete")
    c.itemconfig(mylabel, text=NOTE.get())
    if greeter.get_is_authenticated():
        if not greeter.start_session_sync(LightDM.get_sessions()[0]):
            NOTE.set("Failed to start XFCE")
            c.itemconfig(mylabel, text=NOTE.get())
    else:
        NOTE.set("Login failed.")
        c.itemconfig(mylabel, text=NOTE.get())
Ejemplo n.º 3
0
 def sessions(self):
     return [session_to_dict(session) for session in LightDM.get_sessions()]
Ejemplo n.º 4
0
 def sessions(self):
     return [session_to_dict(session) for session in LightDM.get_sessions()]