[Xfce4-commits] <xfce4-session:master> Add support for launching xfce4-session in consolekit.

Nick Schermer noreply at xfce.org
Sat Mar 24 22:50:14 CET 2012


Updating branch refs/heads/master
         to 77297eb6a5927423d3c82bcc358f236755090b17 (commit)
       from 03d0fc76a246c0ba90bc0684cc3562630917a0c4 (commit)

commit 77297eb6a5927423d3c82bcc358f236755090b17
Author: Nick Schermer <nick at xfce.org>
Date:   Sat Feb 25 10:47:31 2012 +0100

    Add support for launching xfce4-session in consolekit.
    
    Add commandline support to xinitrc to launch xfce4-session
    with ck-launch-session. This will properly launch xfce4-session
    in an active session, including dbus-launch (with is now handled
    by xfce4-session).

 scripts/xinitrc.in.in |   34 +++++++++++++++++++++++++---------
 1 files changed, 25 insertions(+), 9 deletions(-)

diff --git a/scripts/xinitrc.in.in b/scripts/xinitrc.in.in
index 2bfaa45..862f5ce 100755
--- a/scripts/xinitrc.in.in
+++ b/scripts/xinitrc.in.in
@@ -2,11 +2,11 @@
 
 # fix broken $UID on some system...
 if test "x$UID" = "x"; then
-	if test -x /usr/xpg4/bin/id; then
-		UID=`/usr/xpg4/bin/id -u`;
-	else
-		UID=`id -u`;
-	fi
+  if test -x /usr/xpg4/bin/id; then
+    UID=`/usr/xpg4/bin/id -u`;
+  else
+    UID=`id -u`;
+  fi
 fi
 
 # set $XDG_MENU_PREFIX to "xfce-" so that "xfce-applications.menu" is picked
@@ -38,7 +38,6 @@ if test "x$XDG_CACHE_HOME" = "x" ; then
 fi
 [ -d "$XDG_CACHE_HOME" ] || mkdir "$XDG_CACHE_HOME"
 
-
 # set up XDG user directores.  see
 # http://freedesktop.org/wiki/Software/xdg-user-dirs
 if which xdg-user-dirs-update >/dev/null 2>&1; then
@@ -84,14 +83,31 @@ cat /dev/null $XRESOURCES | xrdb -nocpp -merge -
 # load local modmap
 test -r $HOME/.Xmodmap && xmodmap $HOME/.Xmodmap
 
-# Run xfce4-session if installed
+# run xfce4-session if installed
 if which xfce4-session >/dev/null 2>&1; then
+
+  # check if we start xfce4-session with ck-launch-session. this is only
+  # required for starting from a console, not a login manager
+  if test "x$XFCE4_SESSION_WITH_CK" = "x1"; then
+    if which ck-launch-session >/dev/null 2>&1; then
+      ck-launch-session xfce4-session
+    else
+      echo
+      echo "You have tried to start Xfce with consolekit support, but"
+      echo "ck-launch-session is not installed."
+      echo "Aborted startup..."
+      echo
+
+      exit 1
+    fi
+  else
+    # start xfce4-session normally
     xfce4-session
+  fi
 
-    exit 0
+  exit 0
 fi
 
-
 ##################
 # IMPORTANT NOTE #
 ##################


More information about the Xfce4-commits mailing list