A LightDM Mock that is written in modern JavaScript and based on cytodev's LightDMMock, the lightdm-webkit2-greeter manual, the LightDM API documentation, and the latest version of Antergos' lightdm-webkit2-greeter source code.
Go to file
Roel Walraven 8eb53aff09 Fixes undefined user error
aka fixing sloppy code...
2016-08-04 16:57:15 +02:00
mock Fixes undefined user error 2016-08-04 16:57:15 +02:00
license.md Adds readme and license for public GitHub push 2016-07-12 22:54:11 +02:00
readme.md Fix readme steps reading only 1 2016-07-13 00:19:29 +02:00

#LightDMMock A LightDM Mock that is tightly based on the source C code of Antergos' lightdm-webkit2-greeter. Please note that the deprecation errors are intrusive for a reason.

##Usage: [1]. Clone the repo

git clone git@github.com:CytoDev/LightDMMock.git

[2]. Include the file in your theme that needs mocking

<script type="text/javascript" src="mock/LightDMMock.js"></script>

[3]. Create a new instance of LightDMMock

if(!("lightdm" in window)) {
    var LightDMMock = LightDMMock || {};
    window.lightdm = new LightDMMock(autofill, timeout, autoGuest);
}

##Parameters of LightDMMock() ####autofill

boolean
Wether or not the arrays for users, languages, layouts, and sessions need to be filled with mock data. I advise to test both to make your theme less prone to crashing.


####timeout

number
Value to use for simulated autologin (this value is in seconds).


####autoGuest

boolean
Wether or not to simulate automatic guest login. This will also enable a guest account in lightdm.has_guest_account.


###A friendly reminder The following functions must be provided by the custom greeter, which LightDM will call in the process of authenticating the user. This can be found in the original documentation (man pages) of the webkit-greeter, but I have posted them here for your convenience.

show_prompt(text, type)

This will be called when LightDM needs to prompt  the user for some reason, such
as asking for a password. The "text" parameter will  be the  text of the prompt,
and  the  "type"  parameter  will  either  be  "text" for a  visible prompt,  or
"password" for a prompt that the input should be hidden.

show_message(text, type)

This will be called when  LightDM needs to display some info for  the user.  The
"text" parameter will be  the text of the message, and the "type" parameter will
either be "info" for  an  information message,  or "error" for  an error message
that LightDM has encountered.

authentication_complete()

This function is called by LightDM when authentication has completed.

autologin_timer_expired()

This  function is  called by LightDM when  an autologin user's  login timer  has
expired. The greeter should reset the authentication process.

###License: This project is licensed under the MIT License. You can find a copy of the license here.

###Contributions: You are more than welcome to submit issues as well as feature requests or just a 'how-ya-doin' in the issue tracker. Contributing to the project can be done by forking it and submitting a pull request once it's all tested and tidy.