Browse Source

not going to use compton , might do it later.

added CSS stylesheet.
sisyphus
Dustin Falgout 9 years ago
parent
commit
b6c19ef358
  1. 23
      configure.ac
  2. 8
      data/Makefile.am
  3. 37
      data/lightdm-webkit2-greeter-compton.conf
  4. 4
      data/lightdm-webkit2-greeter-start
  5. 2
      data/lightdm-webkit2-greeter.desktop
  6. 10
      src/Makefile.am
  7. 28
      src/lightdm-webkit2-greeter.c

23
configure.ac

@ -38,6 +38,7 @@ AC_SUBST([WEB_EXTENSION_LIBS])
dnl ###########################################################################
dnl Configurable values
dnl ###########################################################################
THEME_DIR="/usr/share/lightdm-webkit/themes"
AC_ARG_WITH(theme-dir,
AS_HELP_STRING(--with-theme-dir=<path>,
@ -49,6 +50,9 @@ AC_ARG_WITH(theme-dir,
AC_SUBST(THEME_DIR)
AC_DEFINE_UNQUOTED(THEME_DIR, "$THEME_DIR", Theme Dir)
dnl ###########################################################################
dnl ###########################################################################
CONFIG_DIR="/etc/lightdm/"
AC_ARG_WITH(config-dir,
AS_HELP_STRING(--with-config-dir=<path>,
@ -60,6 +64,9 @@ AC_ARG_WITH(config-dir,
AC_SUBST(CONFIG_DIR)
AC_DEFINE_UNQUOTED(CONFIG_DIR, "$CONFIG_DIR", Config Dir)
dnl ###########################################################################
dnl ###########################################################################
DESKTOP_DIR="/usr/share/xgreeters/"
AC_ARG_WITH(desktop-dir,
AS_HELP_STRING(--with-desktop-dir=<path>,
@ -71,6 +78,22 @@ AC_ARG_WITH(desktop-dir,
AC_SUBST(DESKTOP_DIR)
AC_DEFINE_UNQUOTED(DESKTOP_DIR, "$DESKTOP_DIR", Desktop Dir)
dnl ###########################################################################
dnl ###########################################################################
AC_ARG_ENABLE([at-spi-command],
AC_HELP_STRING([--enable-at-spi-command[=command]], [Try to start at-spi service]])
AC_HELP_STRING([--disable-at-spi-command], [Do not start at-spi service]),
[], [])
AS_IF([test "x$enable_at_spi_command" != "xno"],
[
if test "x$enable_at_spi_command" = "xyes" || test "x$enable_at_spi_command" = "x"; then
enable_at_spi_command="/usr/lib/at-spi2-core/at-spi-bus-launcher --launch-immediately"
fi
AC_DEFINE_UNQUOTED([AT_SPI_COMMAND], ["$enable_at_spi_command"], [Command to start at-spi service])
])
dnl ###########################################################################
dnl Internationalization
dnl ###########################################################################

8
data/Makefile.am

@ -1,17 +1,13 @@
etcdir = /etc/lightdm/
etc_DATA = \
lightdm-webkit2-greeter.conf \
lightdm-webkit2-greeter-compton.conf
dist_bin_SCRIPTS = lightdm-webkit2-greeter-start
lightdm-webkit2-greeter.conf
desktopdir = $(DESKTOP_DIR)
desktop_DATA = lightdm-webkit2-greeter.desktop
EXTRA_DIST = \
$(etc_DATA) \
$(desktop_DATA) \
$(dist_bin_SCRIPTS)
$(desktop_DATA)
DISTCLEANFILES = \
Makefile.in

37
data/lightdm-webkit2-greeter-compton.conf

@ -6,10 +6,6 @@ clear-shadow = true;
shadow-radius = 7;
shadow-offset-x = -7;
shadow-offset-y = -7;
# shadow-opacity = 0.7;
# shadow-red = 0.0;
# shadow-green = 0.0;
# shadow-blue = 0.0;
shadow-exclude = [
"name = 'Notification'",
"class_g = 'Conky'",
@ -17,70 +13,47 @@ shadow-exclude = [
"class_g = 'Cairo-clock'",
"_GTK_FRAME_EXTENTS@:c"
];
# shadow-exclude = "n:e:Notification";
# shadow-exclude-reg = "x10+0+0";
# xinerama-shadow-crop = true;
# Opacity
menu-opacity = 0.8;
inactive-opacity = 0.8;
# active-opacity = 0.8;
frame-opacity = 0.7;
inactive-opacity-override = false;
alpha-step = 0.06;
# inactive-dim = 0.2;
# inactive-dim-fixed = true;
# blur-background = true;
# blur-background-frame = true;
blur-kern = "3x3box"
# blur-kern = "5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"
# blur-background-fixed = true;
blur-background-exclude = [
"window_type = 'dock'",
"window_type = 'desktop'",
"_GTK_FRAME_EXTENTS@:c"
];
# opacity-rule = [ "80:class_g = 'URxvt'" ];
# Fading
fading = true;
# fade-delta = 30;
fade-in-step = 0.03;
fade-out-step = 0.03;
# no-fading-openclose = true;
# no-fading-destroyed-argb = true;
fade-exclude = [ ];
no-fading-openclose = false;
# Other
backend = "xrender"
backend = "glx"
mark-wmwin-focused = true;
mark-ovredir-focused = true;
# use-ewmh-active-win = true;
detect-rounded-corners = true;
detect-client-opacity = true;
refresh-rate = 0;
vsync = "none";
vsync = "opengl";
dbe = false;
paint-on-overlay = true;
# sw-opti = true;
# unredir-if-possible = true;
# unredir-if-possible-delay = 5000;
# unredir-if-possible-exclude = [ ];
focus-exclude = [ "class_g = 'Cairo-clock'" ];
detect-transient = true;
detect-client-leader = true;
invert-color-include = [ ];
# resize-damage = 1;
# GLX backend
# glx-no-stencil = true;
glx-no-stencil = true;
glx-copy-from-front = false;
# glx-use-copysubbuffermesa = true;
# glx-no-rebind-pixmap = true;
glx-use-copysubbuffermesa = false;
glx-swap-method = "undefined";
# glx-use-gpushader4 = true;
# xrender-sync = true;
# xrender-sync-fence = true;
# Window type settings
wintypes:

4
data/lightdm-webkit2-greeter-start

@ -1,4 +0,0 @@
#!/bin/bash
[[ which compton ]] && compton --config /etc/lightdm/lightdm-webkit2-greeter-compton.conf &
lightdm-webkit2-greeter

2
data/lightdm-webkit2-greeter.desktop

@ -1,6 +1,6 @@
[Desktop Entry]
Name=LightDM WebKit2 Greeter
Comment=LightDM Greeter
Exec=lightdm-webkit2-greeter-start
Exec=lightdm-webkit2-greeter
Type=Application
X-Ubuntu-Gettext-Domain=lightdm-webkit2-greeter

10
src/Makefile.am

@ -24,7 +24,11 @@ liblightdm_webkit2_greeter_ext_la_LDFLAGS = -module -avoid-version -no-undefined
greeter_PROGRAMS = lightdm-webkit2-greeter
greeterdir = $(bindir)
lightdm_webkit2_greeter_built_sources = \
lightdm-webkit2-greeter-css-application.h
lightdm_webkit2_greeter_SOURCES = \
$(lightdm_webkit2_greeter_built_sources) \
lightdm-webkit2-greeter.c
lightdm_webkit2_greeter_CFLAGS = \
@ -40,5 +44,11 @@ lightdm_webkit2_greeter_LDADD = \
$(WEB_EXTENSION_LIBS) \
$(LIBX11_LIBS)
lightdm-webkit2-greeter-css-application.h: $(srcdir)/lightdm-webkit2-greeter-application.css Makefile
$(AM_V_GEN) exo-csource --static --name=lightdm_webkit2_greeter_css_application $< >$@
BUILT_SOURCES = \
$(lightdm_webkit2_greeter_built_sources)
DISTCLEANFILES = \
Makefile.in

28
src/lightdm-webkit2-greeter.c

@ -43,13 +43,15 @@
#include <config.h>
#include "src/lightdm-webkit2-greeter-css-application-css.h"
static GtkWidget *web_view;
static GtkWidget *window;
static WebKitSettings *webkit_settings;
static GdkDisplay *default_display;
/* Screensaver values */
static int timeout, interval, prefer_blanking, allow_exposures;
static int timeout, interval, prefer_blanking, allow_exposures;
static gint config_timeout;
@ -150,13 +152,13 @@ static gboolean
fade_timer_cb(gpointer data) {
gdouble opacity;
opacity = gtk_widget_get_opacity(window);
opacity = gtk_widget_get_opacity(web_view);
opacity -= 0.1;
if (opacity <= 0) {
gtk_main_quit();
return FALSE;
}
gtk_widget_set_opacity(window, opacity);
gtk_widget_set_opacity(web_view, opacity);
return TRUE;
}
@ -180,6 +182,7 @@ main(int argc, char **argv) {
GdkRGBA bg_color;
WebKitUserContentManager *manager;
WebKitWebContext *context;
GtkCssProvider *css_provider;
g_unix_signal_add(SIGTERM, (GSourceFunc) quit_cb, /* is_callback */ GINT_TO_POINTER(TRUE));
@ -188,14 +191,14 @@ main(int argc, char **argv) {
// Apply greeter settings from conf file
keyfile = g_key_file_new();
g_key_file_load_from_file(keyfile, "/etc/lightdm/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);
// Setup the main window
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
screen = gtk_window_get_screen(GTK_WINDOW(window));
root_window = gdk_get_default_root_window();
default_display = gdk_display_get_default();
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
screen = gtk_window_get_screen(GTK_WINDOW(window));
root_window = gdk_get_default_root_window();
default_display = gdk_display_get_default();
gtk_window_set_decorated(GTK_WINDOW(window), FALSE);
gdk_screen_get_monitor_geometry(screen, gdk_screen_get_primary_monitor(screen), &geometry);
@ -207,6 +210,15 @@ main(int argc, char **argv) {
gdk_window_set_events(root_window, gdk_window_get_events(root_window) | GDK_SUBSTRUCTURE_MASK);
gdk_window_add_filter(root_window, wm_window_filter, NULL);
// Setup CSS provider
css_provider = gtk_css_provider_new();
gtk_css_provider_load_from_data(css_provider,
lightdm_webkit2_greeter_css_application,
lightdm_webkit2_greeter_css_application_length, NULL);
gtk_style_context_add_provider_for_screen(screen,
GTK_STYLE_PROVIDER(css_provider),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
// Register and connect handler for setting the web extensions directory so webkit can find our extension
context = webkit_web_context_get_default();
g_signal_connect(context, "initialize-web-extensions", G_CALLBACK(initialize_web_extensions_cb), NULL);

Loading…
Cancel
Save