diff --git a/x-ui.sh b/x-ui.sh index 05ef0064c..81822b9d2 100755 --- a/x-ui.sh +++ b/x-ui.sh @@ -1,37 +1,211 @@ #!/bin/sh -#Xephyr :1 -noreset -ac -br -dpi 142 -screen 240x320x16 & -#Xephyr :1 -noreset -ac -br -dpi 142 -screen 320x240x16 & -#Xephyr :1 -noreset -ac -br -dpi 186 -screen 272x480x16 & -#Xephyr :1 -noreset -ac -br -dpi 186 -screen 480x272x16 & -#Xephyr :1 -noreset -ac -br -dpi 181 -screen 320x320x16 & -#Xephyr :1 -noreset -ac -br -dpi 183 -screen 320x480x16 -host-cursor & -#Xephyr :1 -noreset -ac -br -dpi 183 -screen 480x320x16 -host-cursor & -#Xephyr :1 -noreset -ac -br -dpi 183 -screen 480x800x16 & -#Xephyr :1 -noreset -ac -br -dpi 183 -screen 800x480x16 & -#Xephyr :1 -noreset -ac -br -dpi 284 -screen 480x640x16 & -#Xephyr :1 -noreset -ac -br -dpi 284 -screen 640x480x16 -host-cursor & +DPI=${DPI:-142} +SCREEN=${SCREEN:-240x320} +PROFILE=${PROFILE:-illume-home} +VERBOSE=${VERBOSE:-0} +VALGRIND=${VALGRIND} +VALGRIND_LOG_FILE=${VALGRIND_LOG_FILE} +MASSIF=${MASSIF} +CALLGRIND=${CALLGRIND} +HOST_CURSOR=${HOST_CURSOR} +TEST_HOME=${TEST_HOME} -#Xephyr :1 -noreset -ac -br -dpi 183 -screen 960x400x16 -host-cursor & +show_help() +{ + cat <&2 + ;; + esac +done + +debuggers=0 + +if [ ! -z "$MASSIF" ]; then + DEBUGGER="-massif" + ((debuggers++)) +fi + +if [ ! -z "$CALLGRIND" ]; then + DEBUGGER="-callgrind" + ((debuggers++)) +fi + +if [ ! -z "$VALGRIND" ]; then + DEBUGGER="-valgrind=$VALGRIND" + ((debuggers++)) +fi + +if [ $debuggers -gt 1 ]; then + echo "WARNING: more than one debugger specified. Using $DEBUGGER" 1>&2 +fi + +if [ ! -z "$TEST_HOME" ]; then + if [ "${TEST_HOME#/tmp/}" != "$TEST_HOME" ]; then + # just delete if inside /tmp + rm -fr "$TEST_HOME/" + fi + mkdir -p "$TEST_HOME" +fi + +unset E_RESTART E_START E_IPC_SOCKET E_START_TIME E_CONF_PROFILE + +if [ $VERBOSE -ne 0 ]; then + cat <