Advertisement
Guest User

90-consolekit

a guest
Dec 13th, 2011
397
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. # -*- sh -*-
  2. # Xsession.d script for ck-launch-session.
  3. #
  4. #
  5. # This file is sourced by Xsession(5), not executed.
  6.  
  7. CK_LAUNCH_SESSION=/usr/bin/ck-launch-session
  8.  
  9. is_on_console() {
  10. session=$(dbus-send --system --dest=org.freedesktop.ConsoleKit \
  11. --type=method_call --print-reply --reply-timeout=2000 \
  12. /org/freedesktop/ConsoleKit/Manager \
  13. org.freedesktop.ConsoleKit.Manager.GetCurrentSession \
  14. | grep path | awk '{print $3}' | sed s/\"//g)
  15. x11_display=$(dbus-send --system --dest=org.freedesktop.ConsoleKit \
  16. --type=method_call --print-reply --reply-timeout=2000 \
  17. $session org.freedesktop.ConsoleKit.Session.GetX11Display \
  18. | grep string | awk '{print $2}' | sed s/\"//g)
  19.  
  20. if [ -z "$x11_display" ] ; then
  21. return 0
  22. else
  23. return 1
  24. fi
  25. }
  26.  
  27. # gdm already creates a CK session for us, so do not run the expensive D-Bus
  28. # calls if we have $GDMSESSION
  29. if [ -z "$GDMSESSION" ] && [ -x "$CK_LAUNCH_SESSION" ] && \
  30. ( [ -z "$XDG_SESSION_COOKIE" ] || is_on_console ) ; then
  31. command="$CK_LAUNCH_SESSION $command"
  32.  
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement