All pastes #277518 Raw Edit

Something

public text v1 · immutable
·published 2006-12-13 08:54 UTC
rendered paste body
#!/bin/sh

if test x"$XDG_CONFIG_HOME" = x""
then
  BASEDIR=$HOME/.config/xfce4/
else
  BASEDIR=$XDG_CONFIG_HOME/xfce4
fi

if test x"$XDG_DATA_DIRS" = x""
then
  XDG_DATA_DIRS="/usr/share:/usr/local/share:/usr/share"
else
  XDG_DATA_DIRS="$XDG_DATA_DIRS:/usr/share"
fi
export XDG_DATA_DIRS

if test x"$DISPLAY" = x""
then
  echo "$0: Starting X server"
  prog=xinit
else
  echo "$0: X server already running on display $DISPLAY"
  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
  SERVERRC="/etc/X11/xinit/xserverrc $SERVERRC"
fi

if ! test x"$SERVERRC" = x""
then
  SERVERRC="-- $SERVERRC"
fi

if [ -f $BASEDIR/xinitrc ]; then
  exec $prog $BASEDIR/xinitrc $CLIENTRC $SERVERRC
elif [ -f $HOME/.xfce4/xinitrc ]; then
  mkdir -p $BASEDIR
  cp $HOME/.xfce4/xinitrc $BASEDIR/
  exec $prog $BASEDIR/xinitrc $CLIENTRC $SERVERRC
else
  exec $prog /etc/xdg/xfce4/xinitrc $CLIENTRC $SERVERRC
fi