Guest User

Untitled

a guest
Dec 3rd, 2022
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.09 KB | None | 0 0
  1. #!/bin/sh
  2. #
  3. # xfce4
  4. #
  5. # Copyright (C) 1996-2003 Olivier Fourdan ([email protected])
  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.  
  22. if test "x$*" != "x"
  23. then
  24. OPTS=""
  25. for OPT in $*
  26. do
  27. if test "x$OPT" = "x--help"
  28. then
  29. # print help and exit
  30. echo "Usage:"
  31. echo " startxfce4 [OPTIONS...]"
  32. echo
  33. echo "Options:"
  34. echo " --help Show help options"
  35. echo " --with-ck-launch Start xfce4-session inside a"
  36. echo " ConsoleKit session"
  37. echo
  38.  
  39. exit 0
  40. elif test "x$OPT" = "x--with-ck-launch"
  41. then
  42. # try to launch xfce4-session with ck-launch-session in xinitrc
  43. XFCE4_SESSION_WITH_CK="1"
  44. export XFCE4_SESSION_WITH_CK
  45. else
  46. # append
  47. OPTS="$OPTS $OPT"
  48. fi
  49. done
  50.  
  51. if test "x${OPTS#*--}" = "x${OPTS}"
  52. then
  53. CLIENTRC=${OPTS}
  54. else
  55. SERVERRC=${OPTS#*-- }
  56. CLIENTRC=${OPTS%--*}
  57. fi
  58. fi
  59.  
  60. if test "x$XDG_CONFIG_HOME" = "x"
  61. then
  62. BASEDIR="$HOME/.config/xfce4/"
  63. else
  64. BASEDIR="$XDG_CONFIG_HOME/xfce4"
  65. fi
  66.  
  67. if test "x$XDG_DATA_DIRS" = "x"
  68. then
  69. if test "x/usr/share" = "x/usr/local/share" -o "x/usr/share" = "x/usr/share"; then
  70. XDG_DATA_DIRS="/usr/local/share:/usr/share"
  71. else
  72. XDG_DATA_DIRS="/usr/share:/usr/local/share:/usr/share"
  73. fi
  74. else
  75. XDG_DATA_DIRS="$XDG_DATA_DIRS:/usr/share"
  76. fi
  77. export XDG_DATA_DIRS
  78.  
  79. if test "x$XDG_CONFIG_DIRS" = "x"
  80. then
  81. if test "x/etc" = "x/etc"; then
  82. XDG_CONFIG_DIRS="/etc/xdg"
  83. else
  84. XDG_CONFIG_DIRS="/etc/xdg:/etc/xdg"
  85. fi
  86. else
  87. XDG_CONFIG_DIRS="$XDG_CONFIG_DIRS:/etc/xdg"
  88. fi
  89. export XDG_CONFIG_DIRS
  90.  
  91. if test "x$DISPLAY" = "x"
  92. then
  93. echo "$0: Starting X server"
  94. prog=xinit
  95.  
  96. if test ! "x$XDG_VTNR" = "x"; then
  97. SERVERRC="vt$XDG_VTNR $SERVERRC"
  98. fi
  99. else
  100. echo "$0: X server already running on display $DISPLAY"
  101. prog=/bin/sh
  102. fi
  103.  
  104. if [ -f "$HOME/.xserverrc" ]; then
  105. SERVERRC="$HOME/.xserverrc $SERVERRC"
  106. elif [ -f /etc/X11/xinit/xserverrc ]; then
  107. SERVERRC="/etc/X11/xinit/xserverrc $SERVERRC"
  108. fi
  109.  
  110. if test ! "x$SERVERRC" = "x"
  111. then
  112. SERVERRC="-- $SERVERRC"
  113. fi
  114.  
  115. if [ -f $BASEDIR/xinitrc ]; then
  116. exec $prog $BASEDIR/xinitrc $CLIENTRC $SERVERRC
  117. elif [ -f $HOME/.xfce4/xinitrc ]; then
  118. mkdir -p $BASEDIR
  119. cp $HOME/.xfce4/xinitrc $BASEDIR/
  120. exec $prog $BASEDIR/xinitrc $CLIENTRC $SERVERRC
  121. else
  122. exec $prog /etc/xdg/xfce4/xinitrc $CLIENTRC $SERVERRC
  123. fi
  124.  
Advertisement
Add Comment
Please, Sign In to add comment