File: 90-consolekit.in

package info (click to toggle)
consolekit2 1.2.6-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,568 kB
  • sloc: ansic: 23,228; xml: 2,126; makefile: 1,145; sh: 677; python: 585
file content (32 lines) | stat: -rw-r--r-- 1,002 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# -*- sh -*-
# Xsession.d script for ck-launch-session.
#
#
# This file is sourced by Xsession(5), not executed.

@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
    STARTUP="$CK_LAUNCH_SESSION $STARTUP"
fi