From: Michael Terry Date: Thu, 28 Jul 2011 14:47:08 +0000 (-0400) Subject: add gdmflexiserver helper script X-Git-Url: https://rtime.felk.cvut.cz/gitweb/sojka/lightdm.git/commitdiff_plain/fbdf4d545149c7cbd3facfb7c49d07e8b617ce94 add gdmflexiserver helper script --- diff --git a/Makefile.am b/Makefile.am index c7cb5426..262c750b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,7 +5,7 @@ endif if COMPILE_LIBLIGHTDM_QT SUBDIRS += liblightdm-qt endif -SUBDIRS += data greeters po src doc tests +SUBDIRS += data gdmflexiserver greeters po src doc tests DISTCHECK_CONFIGURE_FLAGS = --enable-introspection --enable-gtk-doc diff --git a/configure.ac b/configure.ac index 65a3627c..35d125df 100644 --- a/configure.ac +++ b/configure.ac @@ -184,6 +184,7 @@ Makefile data/Makefile data/init/Makefile doc/Makefile +gdmflexiserver/Makefile greeters/Makefile greeters/gtk/Makefile greeters/qt/Makefile diff --git a/gdmflexiserver/Makefile.am b/gdmflexiserver/Makefile.am new file mode 100644 index 00000000..45cae144 --- /dev/null +++ b/gdmflexiserver/Makefile.am @@ -0,0 +1 @@ +pkglibexec_SCRIPTS = gdmflexiserver diff --git a/gdmflexiserver/gdmflexiserver b/gdmflexiserver/gdmflexiserver new file mode 100755 index 00000000..3168e177 --- /dev/null +++ b/gdmflexiserver/gdmflexiserver @@ -0,0 +1,22 @@ +#!/bin/sh +# +# Copyright (C) 2011 Canonical Ltd +# Author: Michael Terry +# +# This program is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, version 3 of the License. +# +# See http://www.gnu.org/copyleft/gpl.html for the full text of the license. + +SEAT=$(dbus-send --system --type=method_call --print-reply --dest=org.freedesktop.DisplayManager /org/freedesktop/DisplayManager org.freedesktop.DisplayManager.GetSeatForCookie string:"$XDG_SESSION_COOKIE" 2>/dev/null) + +# Pull out seat path +SEAT=$(echo $SEAT | sed 's/.* object path "\(.*\)"/\1/') + +if [ -z "$SEAT" ]; then + # something went wrong + exit 1 +fi + +dbus-send --system --type=method_call --print-reply --dest=org.freedesktop.DisplayManager $SEAT org.freedesktop.DisplayManager.Seat.SwitchToGreeter diff --git a/src/Makefile.am b/src/Makefile.am index 9687c4c4..07275f71 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -69,6 +69,7 @@ BUILT_SOURCES = \ lightdm_CFLAGS = \ $(LIGHTDM_CFLAGS) \ $(WARN_CFLAGS) \ + -DPKGLIBEXEC_DIR=\"$(pkglibexecdir)\" \ -DCONFIG_DIR=\"$(sysconfdir)/lightdm\" \ -DLOG_DIR=\"$(localstatedir)/log/lightdm\" \ -DRUN_DIR=\"$(localstatedir)/run/lightdm\" \