[Xfce4-commits] <xfce4-session:nick/shutdown-cleanup> Add --with-ck-launch support to startxfce4.

Nick Schermer noreply at xfce.org
Sun Feb 26 11:02:02 CET 2012


Updating branch refs/heads/nick/shutdown-cleanup
         to c4ce63748c726d3e9614d1dbd3f9e1963acc5fa2 (commit)
       from 20c4d7ca8a978cbb82b3940cb12fdd8059356db9 (commit)

commit c4ce63748c726d3e9614d1dbd3f9e1963acc5fa2
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