]> rtime.felk.cvut.cz Git - sojka/lightdm.git/commitdiff
add gdmflexiserver helper script
authorMichael Terry <michael.terry@canonical.com>
Thu, 28 Jul 2011 14:47:08 +0000 (10:47 -0400)
committerMichael Terry <michael.terry@canonical.com>
Thu, 28 Jul 2011 14:47:08 +0000 (10:47 -0400)
Makefile.am
configure.ac
gdmflexiserver/Makefile.am [new file with mode: 0644]
gdmflexiserver/gdmflexiserver [new file with mode: 0755]
src/Makefile.am

index c7cb54265768ca8a6aa67a74c60864deade5e88f..262c750bbedc5b463982e716f3940ed5057f9aa9 100644 (file)
@@ -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
 
index 65a3627cb6845278fcd5f490c26439037aaef0ee..35d125dfd4ec1a8df3a0b6864fbe850464a80773 100644 (file)
@@ -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 (file)
index 0000000..45cae14
--- /dev/null
@@ -0,0 +1 @@
+pkglibexec_SCRIPTS = gdmflexiserver
diff --git a/gdmflexiserver/gdmflexiserver b/gdmflexiserver/gdmflexiserver
new file mode 100755 (executable)
index 0000000..3168e17
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/sh
+#
+# Copyright (C) 2011 Canonical Ltd
+# Author: Michael Terry <michael.terry@canonical.com>
+# 
+# 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
index 9687c4c4e33c5b286de5ea32dbbe3770c603d7b9..07275f71d9fcf43e3c95d1944df74bca5f6ae8a5 100644 (file)
@@ -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\" \