File startscrotwm of Package scrotwm

#!/bin/sh

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

if test "x$XDG_DATA_DIRS" = "x"
then
  XDG_DATA_DIRS="/usr/local/share:/usr/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/.scrotwm/xinitrc ]; then
  mkdir -p $BASEDIR
  cp $HOME/.scrotwm/xinitrc $BASEDIR/
  exec $prog $BASEDIR/xinitrc $CLIENTRC $SERVERRC
else
  exec $prog /etc/xdg/scrotwm/xinitrc $CLIENTRC $SERVERRC
fi  

openSUSE Build Service is sponsored by