void-packages/srcpkgs/ConsoleKit/files/90-consolekit-3
Juan RP 5e1050d950 Revert "ConsoleKit: switch to the ConsoleKit2 fork (0.9.1)."
This reverts commit df599586c6.

Re-add the original ConsoleKit for now.
2014-10-24 08:19:31 +02:00

32 lines
1 KiB
Bash

# -*- sh -*-
# Xsession.d script for ck-launch-session.
#
#
# This file is sourced by Xsession(5), not executed.
CK_LAUNCH_SESSION=/usr/bin/ck-launch-session
is_on_console() {
session=$(dbus-send --system --dest=org.freedesktop.ConsoleKit \
--type=method_call --print-reply --reply-timeout=2000 \
/org/freedesktop/ConsoleKit/Manager \
org.freedesktop.ConsoleKit.Manager.GetCurrentSession \
| grep path | awk '{print $3}' | sed s/\"//g)
x11_display=$(dbus-send --system --dest=org.freedesktop.ConsoleKit \
--type=method_call --print-reply --reply-timeout=2000 \
$session org.freedesktop.ConsoleKit.Session.GetX11Display \
| grep string | awk '{print $2}' | sed s/\"//g)
if [ -z "$x11_display" ] ; then
return 0
else
return 1
fi
}
# gdm already creates a CK session for us, so do not run the expensive D-Bus
# calls if we have $GDMSESSION
if [ -z "$GDMSESSION" ] && [ -x "$CK_LAUNCH_SESSION" ] && \
( [ -z "$XDG_SESSION_COOKIE" ] || is_on_console ) ; then
command="$CK_LAUNCH_SESSION $command"
fi