]> rtime.felk.cvut.cz Git - sojka/lightdm.git/blob - src/gdmflexiserver
Add a gdmflexiserver binary that provides backwards compatibility with existing sessions
[sojka/lightdm.git] / src / gdmflexiserver
1 #!/bin/sh
2 #
3 # Copyright (C) 2011 Canonical Ltd
4 # Author: Michael Terry <michael.terry@canonical.com>
5
6 # This program is free software: you can redistribute it and/or modify it under
7 # the terms of the GNU General Public License as published by the Free Software
8 # Foundation, version 3 of the License.
9 #
10 # See http://www.gnu.org/copyleft/gpl.html for the full text of the license.
11
12 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)
13
14 # Pull out seat path
15 SEAT=$(echo $SEAT | sed 's/.* object path "\(.*\)"/\1/')
16
17 if [ -z "$SEAT" ]; then
18   # something went wrong
19   exit 1
20 fi
21
22 dbus-send --system --type=method_call --print-reply --dest=org.freedesktop.DisplayManager $SEAT org.freedesktop.DisplayManager.Seat.SwitchToGreeter