[Xfce4-commits] <xfce4-session:master> Add --with-ck-launch support to startxfce4.

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


Updating branch refs/heads/master
         to 1920277baad82a4e0bf21d83fa5af15259a79720 (commit)
       from fdc6eb0b496c4c1c11e8357b8fddf9cb86da54d9 (commit)

commit 1920277baad82a4e0bf21d83fa5af15259a79720
Author: Nick Schermer <nick at xfce.org>
Date:   Sun Feb 26 10:59:58 2012 +0100

    Add --with-ck-launch support to startxfce4.
    
    This will set XFCE4_SESSION_WITH_CK=1 so we start xfce4-session
    with ck-launch-session. That should resolve the numerous
    ways people start Xfce manually from xinit.

 scripts/startxfce4.in |   52 ++++++++++++++++++++++++++++++++++++------------
 1 files changed, 39 insertions(+), 13 deletions(-)

diff --git a/scripts/startxfce4.in b/scripts/startxfce4.in
index 7a871d2..b346d8f 100644
--- a/scripts/startxfce4.in
+++ b/scripts/startxfce4.in
@@ -19,6 +19,44 @@
 #  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 #
 
+if test "x$*" != "x"
+then
+  OPTS=""
+  for OPT in $*
+  do
+    if test "x$OPT" == "x--help"
+    then
+      # print help and exit
+      echo "Usage:"
+      echo "  startxfce4 [OPTIONS...]"
+      echo
+      echo "Options:"
+      echo "  --help                   Show help options"
+      echo "  --with-ck-launch         Start xfce4-session inside a"
+      echo "                           ConsoleKit session"
+      echo
+
+      exit 0
+    elif test "x$OPT" == "x--with-ck-launch"
+    then
+      # try to launch xfce4-session with ck-launch-session in xinitrc
+      XFCE4_SESSION_WITH_CK="1"
+      export XFCE4_SESSION_WITH_CK
+    else
+      # append
+      OPTS="$OPTS $OPT"
+    fi
+  done
+
+  if test "x${OPTS#*--}" = "x${OPTS}"
+  then
+    CLIENTRC=${OPTS}
+  else
+    SERVERRC=${OPTS#*-- }
+    CLIENTRC=${OPTS%--*}
+  fi
+fi
+
 if test "x$XDG_CONFIG_HOME" = "x"
 then
   BASEDIR="$HOME/.config/xfce4/"
@@ -59,18 +97,6 @@ else
   prog=/bin/sh
 fi
 
-if test ! "x$*" = "x"
-then
-  OPT=$*
-  if test "x${OPT#*--}" = "x${OPT}"
-  then
-    CLIENTRC=${OPT}
-  else
-    SERVERRC=${OPT#*-- }
-    CLIENTRC=${OPT%--*}
-  fi
-fi
-
 if [ -f "$HOME/.xserverrc" ]; then
   SERVERRC="$HOME/.xserverrc $SERVERRC"
 elif [ -f /etc/X11/xinit/xserverrc ]; then
@@ -90,5 +116,5 @@ elif [ -f $HOME/.xfce4/xinitrc ]; then
   exec $prog $BASEDIR/xinitrc $CLIENTRC $SERVERRC
 else
   exec $prog @_sysconfdir_@/xdg/xfce4/xinitrc $CLIENTRC $SERVERRC
-fi  
+fi
 


More information about the Xfce4-commits mailing list