Browse Source

Merge branch 'master' of github.com:sbalneav/lightdm-webkit2-greeter

# Conflicts:
#	src/lightdm-webkit2-greeter-ext.c
sisyphus
Dustin Falgout 9 years ago
parent
commit
497c6608cb
  1. 3
      .gitmodules
  2. 2
      Makefile.am
  3. 21
      configure.ac
  4. 1
      man/Makefile.am
  5. 267
      man/lightdm-webkit2-greeter.1
  6. 649
      src/lightdm-webkit2-greeter-ext.c
  7. 2
      src/lightdm-webkit2-greeter.c
  8. 2
      themes/Makefile.am
  9. 9
      themes/simple/Makefile.am
  10. 165
      themes/simple/index.html
  11. 6
      themes/simple/index.theme
  12. BIN
      themes/simple/power_button.png

3
.gitmodules vendored

@ -1,3 +1,6 @@
[submodule "themes/antergos"] [submodule "themes/antergos"]
path = themes/antergos path = themes/antergos
url = http://github.com/antergos/lightdm-webkit-theme-antergos.git url = http://github.com/antergos/lightdm-webkit-theme-antergos.git
[submodule "themes/lightdm-webkit-theme-antergos"]
path = themes/lightdm-webkit-theme-antergos
url = http://github.com/antergos/lightdm-webkit-theme-antergos.git

2
Makefile.am

@ -1,4 +1,4 @@
SUBDIRS = data po src themes SUBDIRS = data man po src themes
DISTCLEANFILES = \ DISTCLEANFILES = \
Makefile.in \ Makefile.in \

21
configure.ac

@ -34,6 +34,13 @@ PKG_CHECK_MODULES([WEB_EXTENSION], [webkit2gtk-web-extension-4.0 >= 2.8.0])
AC_SUBST([WEB_EXTENSION_CFLAGS]) AC_SUBST([WEB_EXTENSION_CFLAGS])
AC_SUBST([WEB_EXTENSION_LIBS]) AC_SUBST([WEB_EXTENSION_LIBS])
# Check for exo-csource
AC_DEFUN([AC_PROG_EXOCSOURCE], [AC_CHECK_PROG(EXOCSOURCE,exo-csource,yes)])
AC_PROG_EXOCSOURCE
if test x"${EXOCSOURCE}" != x"yes" ; then
AC_MSG_ERROR([Please install the package containing the exo-csource binary.])
fi
dnl ########################################################################### dnl ###########################################################################
dnl Configurable values dnl Configurable values
dnl ########################################################################### dnl ###########################################################################
@ -108,19 +115,21 @@ dnl ###########################################################################
AC_OUTPUT([ AC_OUTPUT([
Makefile Makefile
data/Makefile data/Makefile
man/Makefile
src/Makefile src/Makefile
po/Makefile.in po/Makefile.in
themes/Makefile themes/Makefile
themes/antergos/css/vendor/Makefile
themes/antergos/css/Makefile
themes/antergos/Makefile themes/antergos/Makefile
themes/antergos/fonts/Makefile
themes/antergos/fonts/font-awesome/Makefile
themes/antergos/fonts/TTF/Makefile
themes/antergos/js/vendor/Makefile
themes/antergos/js/Makefile themes/antergos/js/Makefile
themes/antergos/img/Makefile themes/antergos/img/Makefile
themes/antergos/img/thumbs/Makefile themes/antergos/img/thumbs/Makefile
themes/antergos/font-awesome/Makefile themes/simple/Makefile
themes/antergos/font-awesome/fonts/Makefile
themes/antergos/font-awesome/css/Makefile
themes/antergos/css/Makefile
themes/antergos/css/lib/Makefile
themes/antergos/css/bootstrap/Makefile
]) ])
dnl ########################################################################### dnl ###########################################################################

1
man/Makefile.am

@ -0,0 +1 @@
dist_man_MANS = lightdm-webkit2-greeter.1

267
man/lightdm-webkit2-greeter.1

@ -0,0 +1,267 @@
.TH "LIGHTDM" "1" "2015/11/14"
.nh
.ad l
.SH "NAME"
lightdm-webkit2-greeter \- Themeable greeter for LightDM which uses webkit2\&.
.SH "SYNOPSIS"
.HP \w'\fBlightdm-webkit2-greeter\fR\ 'u
\fBlightdm-webkit2-greeter\fR
.SH "DESCRIPTION"
.PP
lightdm-webkit2-greeter is a LightDM greeter that uses webkit2 as the theming
engine\&. Greeters can be written in a combination of HTML and Javascript\&.
.PP
.SH "API"
Please note that all functions or variables marked "deprecated" are still
available for backwards compatibility, but may disappear in a future version of
lightdm-webkit2-greeter\&. Authors of themes should use the new functions and
variables, which more closely match the LightDM API\&.
.PP
The following functions \fBmust\fR be provided by the custom greeter, which LightDM
will call in the process of authenticating the user\&.
.PP
\fBshow_prompt(text, type)\fR
.RS 4
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\&.
.RE
.PP
\fBshow_message(text, type)\fR
.RS 4
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\&.
.RE
.PP
\fBauthentication_complete()\fR
.RS 4
This function is called by LightDM when authentication has completed\&.
.RE
.PP
\fBautologin_timer_expired()\fR
.RS 4
This function is called by LightDM when an autologin user's login timer has
expired\&. The greeter should reset the authentication process\&.
.RE
.PP
The following functions are available for the greeter to call to execute
actions within LightDM\&.
.PP
\fBlightdm\&.authenticate(name)\fR
.RS 4
Specifies the name of the user we'd like to start authenticating as\&. Note that
if you pass an empty string (""), LightDM (via PAM) will issue a show_prompt()
call to ask for the username\&. The older function
lightdm\&.start_authentication() has been deprecated\&.
.RE
.PP
\fBlightdm\&.authenticate_as_guest()\fR
.RS 4
Authenticates as the guest user\&.
.RE
.PP
\fBlightdm\&.cancel_authentication()\fR
.RS 4
Cancels the authentication of any user currently in the process of
authenticating\&.
.RE
.PP
\fBlightdm\&.cancel_autologin()\fR
.RS 4
Cancels the authentication of the autologin user\&. The older function
lightdm\&.cancel_timed_login() has been deprecated.
.RE
.PP
\fBlightdm\&.get_hint(hint_name)\fR
.RS 4
Returns the value of a named hint provided by LightDM\&.
.RE
.PP
\fBlightdm\&.hibernate()\fR
.RS 4
Hibernates the system, if the greeter has the authority to do so\&.
.RE
.PP
\fBlightdm\&.start_session_sync(user, session)\fR
.RS 4
Once LightDM has successfully authenticated the user, start the user's session
by calling this function\&. "user" is the authenticated user, and "session" is
the user's session\&. The older function lightdm\&.login() has been
deprecated\&.
.RE
.PP
\fBlightdm\&.respond(text)\fR
.RS 4
When LightDM has prompted for input, provide the response to LightDM\&.
The deprecated function was "provide_secret"\&. This is still available for
backwards compatibility, but authors of greeters should move to using
lightdm.respond()\&.
.RE
.PP
\fBlightdm\&.restart()\fR
.RS 4
Restarts the system, if the greeter has the authority to do so\&.
.RE
.PP
\fBlightdm\&.set_language(lang)\fR
.RS 4
Will set the language for the current LightDM session\&.
.RE
.PP
\fBlightdm\&.shutdown()\fR
.RS 4
Shuts down the system, if the greeter has the authority to do so\&.
.RE
.PP
Variables available within the greeter are:
.PP
\fBlightdm\&.authentication_user\fR
.RS 4
String\&. The username of the authentication user being authenticated or null if no
authentication is in progress\&.
.RE
.PP
\fBlightdm\&.autologin_guest\fR
.RS 4
Boolean\&. Indicates the guest user should be used for autologin\&.
.RE
.PP
\fBlightdm\&.autologin_timeout\fR
.RS 4
Number\&. The number of seconds to wait before automatically logging in\&. The
older variable lightdm\&.timed_user_delay has been deprecated\&.
.RE
.PP
\fBlightdm\&.autologin_user\fR
.RS 4
String\&. The name of the user account that should be logged into
automatically after timed login delay has passed\&. The older variable
lightdm\&.timed_login_user has been deprecated\&.
.RE
.PP
\fBlightdm\&.can_hibernate\fR
.RS 4
Boolean\&. Whether or not the system can be made to hibernate by the greeter\&.
.RE
.PP
\fBlightdm\&.can_restart\fR
.RS 4
Boolean\&. Whether or not the system can be restarted by the greeter\&.
.RE
.PP
\fBlightdm\&.can_shutdown\fR
.RS 4
Boolean\&. Whether or not the system can be shutdown by the greeter\&.
.RE
.PP
\fBlightdm\&.can_suspend\fR
.RS 4
Boolean\&. Whether or not the system can be suspended by the greeter\&.
.RE
.PP
\fBlightdm\&.default_session\fR
.RS 4
String\&. The name of the default session (as configured in lightdm.conf)\&.
.RE
.PP
\fBlightdm\&.has_guest_account\fR
.RS 4
Boolean\&. A guest account is available for login\&.
.RE
.PP
\fBlightdm\&.hide_users\fR
.RS 4
Boolean\&. The whole list of users should not be displayed\&.
.RE
.PP
\fBlightdm\&.hostname\fR
.RS 4
String\&. The hostname of the system\&.
.RE
.PP
\fBlightdm\&.is_authenticated\fR
.RS 4
Boolean\&. Indicates if the user has successfully authenticated\&.
.RE
.PP
\fBlightdm\&.in_authentication\fR
.RS 4
Boolean\&. Indicates if lightdm is currently in the authentication phase\&.
.RE
.PP
\fBlightdm\&.language\fR
.RS 4
String\&. The currently selected language\&. The older variable name
lightdm\&.default_language is deprecated\&.
.RE
.PP
\fBlightdm\&.layout\fR
.RS 4
String\&. The name of the currently active keyboard layout\&. To change the
layout, assign a valid layout name to this variable\&. The older variable name
lightdm\&.default_layout is deprecated\&.
.RE
.PP
\fBlightdm\&.layouts\fR
.RS 4
Array\&. The keyboard layouts that are available on the system\&. Returns an Array
of LightDMLayout objects\&.
.RE
.PP
\fBlightdm\&.num_users\fR
.RS 4
Number\&. The number of users able to log in\&.
.RE
.PP
\fBlightdm\&.select_guest\fR
.RS 4
Boolean\&. The guest user should be selected by default for login\&.
.RE
.PP
\fBlightdm\&.select_user\fR
.RS 4
String\&. The username that should be selected by default for login\&.
.RE
.PP
\fBlightdm\&.sessions\fR
.RS 4
Array\&. The sessions that are available on the system\&. Returns an Array of
LightDMSession objects\&.
.RE
.PP
\fBlightdm\&.users\fR
.RS 4
Array\&. The users that are able to log in\&. Returns an Array of LightDMUser
objects\&.
.RE
.PP
Please see the LightDM API documentation for the complete list of calls
available\&. The lightdm-webkit2-greeter implements all of the LightDM API\&.
.PP
.SH "CONFIGURATION"
.PP
\fB/etc/lightdm/lightdm-webkit2-greeter\&.conf\fR
.RS 4
Keyfile that contains one key: webkit-theme\&. This should point to which
theme the greeter should use\&.
.RE
.SH "FILES"
.PP
\fB/usr/share/lightdm-webkit-themes\fR
.RS 4
Directory where themes should be stored\&.
.RE
.SH "EXAMPLES"
.PP
Please see the "antergos" and "simple" themes that are shipped with
lightdm-webkit2-greeter\&.
.SH "SEE ALSO"
.PP
http://people\&.ubuntu\&.com/~robert-ancell/lightdm/reference/core\&.html
.SH "AUTHOR"
.PP
lightdm-webkit-greeter was written by Robert Ancell <robert\&.ancell\&@canonical\&.com\&>\&.
lightdm-webkit2-greeter was ported to webkit2 by the Antergos Developers <dev@antergos\&.com>

649
src/lightdm-webkit2-greeter-ext.c

File diff suppressed because it is too large Load Diff

2
src/lightdm-webkit2-greeter.c

@ -190,7 +190,7 @@ main(int argc, char **argv) {
// Apply greeter settings from conf file // Apply greeter settings from conf file
keyfile = g_key_file_new(); keyfile = g_key_file_new();
g_key_file_load_from_file(keyfile, "/etc/lightdm/lightdm-webkit2-greeter.conf", G_KEY_FILE_NONE, NULL); g_key_file_load_from_file(keyfile, CONFIG_DIR "/lightdm-webkit2-greeter.conf", G_KEY_FILE_NONE, NULL);
theme = g_key_file_get_string(keyfile, "greeter", "webkit-theme", NULL); theme = g_key_file_get_string(keyfile, "greeter", "webkit-theme", NULL);
config_timeout = g_key_file_get_integer(keyfile, "greeter", "screensaver-timeout", NULL); config_timeout = g_key_file_get_integer(keyfile, "greeter", "screensaver-timeout", NULL);

2
themes/Makefile.am

@ -1,4 +1,4 @@
SUBDIRS = antergos SUBDIRS = antergos simple
DISTCLEANFILES = \ DISTCLEANFILES = \
Makefile.in Makefile.in

9
themes/simple/Makefile.am

@ -0,0 +1,9 @@
themedir = $(THEME_DIR)/simple
theme_DATA = index.html index.theme power_button.png
EXTRA_DIST = $(theme_DATA)
DISTCLEANFILES = \
Makefile.in

165
themes/simple/index.html

@ -0,0 +1,165 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
<style type="text/css">
td
{
font-size: 24px;
vertical-align: middle;
}
input
{
font-size: 24px;
}
html
{
height: 100%;
}
body
{
background: linear-gradient(white, SlateGray);
}
.topBox
{
height: 490px;
}
.inputBox
{
width: 100%;
}
.messageBox
{
font-size: 24px;
width: 60%;
margin-left: auto;
margin-right: auto;
display: block;
text-align: center;
visibility: hidden;
}
</style>
<script type="text/javascript">
/*********************************************************************/
/* Callbacks for lightdm-webkit-greeter */
/*********************************************************************/
/*
* show_prompt callback.
*/
function show_prompt(text, type)
{
// type is either "text" or "password"
prompt = document.getElementById("prompt");
prompt.innerHTML = text;
entry = document.getElementById("entry");
entry.value = ""; // clear entry
entry.type = type;
entry.focus();
}
/*
* show_message callback.
*/
function show_message(text, type)
{
if (text.length == 0)
return;
messages = document.getElementById("messages");
messages.style.visibility = "visible";
// type is either "info" or "error"
if (type == "error") {
text = "<font color=\"red\">" + text + "</font>";
}
text = text + "<br>";
messages.innerHTML = messages.innerHTML + text;
}
/*
* authentication_complete callback.
*/
function authentication_complete()
{
if (lightdm.is_authenticated) {
lightdm.start_session_sync (lightdm.authentication_user, lightdm.default_session);
} else {
show_message ("Authentication Failed", "error");
setTimeout (start_authentication, 3000);
}
}
/*
* autologin_timer_expired callback.
*/
function autologin_timer_expired(username)
{
/* Stub. Does nothing. */
}
/*********************************************************************/
/* Functions local to this greeter */
/*********************************************************************/
/*
* clear_messages
*/
function clear_messages()
{
messages = document.getElementById("messages");
messages.innerHTML = "";
messages.style.visibility = "hidden";
}
/*
* Kickoff the authentication process
*/
function start_authentication()
{
clear_messages();
lightdm.authenticate(""); // start with null userid, have pam prompt for userid.
}
/*
* handle the input from the entry field.
*/
function handle_input()
{
entry = document.getElementById("entry");
lightdm.respond(entry.value);
}
</script>
</head>
<body>
<img style="float: right;" onclick="javascript:lightdm.shutdown();" src="power_button.png" />
<div class="topBox"></div>
<div class="inputBox">
<table id="input_table" width="100%">
<tr>
<td id="prompt" width="45%" align="right"></td>
<td width="55%"><form action="javascript: handle_input()"><input id="entry"></form></td>
</tr>
</table>
</div>
<div class="messageBox" id="messages"></div>
<script type="text/javascript">
start_authentication();
</script>
</body>
</html>

6
themes/simple/index.theme

@ -0,0 +1,6 @@
[theme]
name=Simple
description=Simple Theme
engine=lightdm-webkit-greeter
url=index.html
session=gnome

BIN
themes/simple/power_button.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Loading…
Cancel
Save