You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

121 lines
2.9 KiB

  1. #!/bin/sh
  2. #
  3. # xfce4
  4. #
  5. # Copyright (C) 1996-2003 Olivier Fourdan (fourdan@xfce.org)
  6. #
  7. # This program is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation; either version 2 of the License, or
  10. # (at your option) any later version.
  11. #
  12. # This program is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU General Public License
  18. # along with this program; if not, write to the Free Software
  19. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  20. #
  21. if test "x$*" != "x"
  22. then
  23. OPTS=""
  24. for OPT in $*
  25. do
  26. if test "x$OPT" = "x--help"
  27. then
  28. # print help and exit
  29. echo "Usage:"
  30. echo " startxfce4 [OPTIONS...]"
  31. echo
  32. echo "Options:"
  33. echo " --help Show help options"
  34. echo " --with-ck-launch Start xfce4-session inside a"
  35. echo " ConsoleKit session"
  36. echo
  37. exit 0
  38. elif test "x$OPT" = "x--with-ck-launch"
  39. then
  40. # try to launch xfce4-session with ck-launch-session in xinitrc
  41. XFCE4_SESSION_WITH_CK="1"
  42. export XFCE4_SESSION_WITH_CK
  43. else
  44. # append
  45. OPTS="$OPTS $OPT"
  46. fi
  47. done
  48. if test "x${OPTS#*--}" = "x${OPTS}"
  49. then
  50. CLIENTRC=${OPTS}
  51. else
  52. SERVERRC=${OPTS#*-- }
  53. CLIENTRC=${OPTS%--*}
  54. fi
  55. fi
  56. if test "x$XDG_CONFIG_HOME" = "x"
  57. then
  58. BASEDIR="$HOME/.config/xfce4/"
  59. else
  60. BASEDIR="$XDG_CONFIG_HOME/xfce4"
  61. fi
  62. if test "x$XDG_DATA_DIRS" = "x"
  63. then
  64. if test "x@_datadir_@" = "x/usr/local/share" -o "x@_datadir_@" = "x/usr/share"; then
  65. XDG_DATA_DIRS="/usr/local/share:/usr/share"
  66. else
  67. XDG_DATA_DIRS="@_datadir_@:/usr/local/share:/usr/share"
  68. fi
  69. else
  70. XDG_DATA_DIRS="$XDG_DATA_DIRS:@_datadir_@"
  71. fi
  72. export XDG_DATA_DIRS
  73. if test "x$XDG_CONFIG_DIRS" = "x"
  74. then
  75. if test "x@_sysconfdir_@" = "x/etc"; then
  76. XDG_CONFIG_DIRS="/etc/xdg"
  77. else
  78. XDG_CONFIG_DIRS="/etc/xdg:@_sysconfdir_@/xdg"
  79. fi
  80. else
  81. XDG_CONFIG_DIRS="$XDG_CONFIG_DIRS:@_sysconfdir_@/xdg"
  82. fi
  83. export XDG_CONFIG_DIRS
  84. if test "x$DISPLAY" = "x"
  85. then
  86. echo "$0: Starting X server"
  87. prog=xinit
  88. else
  89. echo "$0: X server already running on display $DISPLAY"
  90. prog=/bin/sh
  91. fi
  92. if [ -f "$HOME/.xserverrc" ]; then
  93. SERVERRC="$HOME/.xserverrc $SERVERRC"
  94. elif [ -f /etc/X11/xinit/xserverrc ]; then
  95. SERVERRC="/etc/X11/xinit/xserverrc $SERVERRC"
  96. fi
  97. if test ! "x$SERVERRC" = "x"
  98. then
  99. SERVERRC="-- $SERVERRC"
  100. fi
  101. if [ -f $BASEDIR/xinitrc ]; then
  102. exec $prog $BASEDIR/xinitrc $CLIENTRC $SERVERRC
  103. elif [ -f $HOME/.xfce4/xinitrc ]; then
  104. mkdir -p $BASEDIR
  105. cp $HOME/.xfce4/xinitrc $BASEDIR/
  106. exec $prog $BASEDIR/xinitrc $CLIENTRC $SERVERRC
  107. else
  108. exec $prog @_sysconfdir_@/xdg/xfce4/xinitrc $CLIENTRC $SERVERRC
  109. fi