summaryrefslogtreecommitdiff
path: root/x-ui.sh
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2010-06-03 23:00:25 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2010-06-03 23:00:25 +0000
commitf8e00c781f576a2a81389751ffbcfb5e7f3c0655 (patch)
treef77b68613a9fcf6e8d09189a83281237a40507a6 /x-ui.sh
parent947ced04ae31af6aba7f755a0d05dcebeef94b84 (diff)
x-ui.sh is now command-line/env-vars configurable.
Make it easier to test with common cases, like debuggers, clean/empty $HOME and so on. SVN revision: 49425
Diffstat (limited to 'x-ui.sh')
-rwxr-xr-xx-ui.sh230
1 files changed, 202 insertions, 28 deletions
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 @@
1#!/bin/sh 1#!/bin/sh
2 2
3#Xephyr :1 -noreset -ac -br -dpi 142 -screen 240x320x16 & 3DPI=${DPI:-142}
4#Xephyr :1 -noreset -ac -br -dpi 142 -screen 320x240x16 & 4SCREEN=${SCREEN:-240x320}
5#Xephyr :1 -noreset -ac -br -dpi 186 -screen 272x480x16 & 5PROFILE=${PROFILE:-illume-home}
6#Xephyr :1 -noreset -ac -br -dpi 186 -screen 480x272x16 & 6VERBOSE=${VERBOSE:-0}
7#Xephyr :1 -noreset -ac -br -dpi 181 -screen 320x320x16 & 7VALGRIND=${VALGRIND}
8#Xephyr :1 -noreset -ac -br -dpi 183 -screen 320x480x16 -host-cursor & 8VALGRIND_LOG_FILE=${VALGRIND_LOG_FILE}
9#Xephyr :1 -noreset -ac -br -dpi 183 -screen 480x320x16 -host-cursor & 9MASSIF=${MASSIF}
10#Xephyr :1 -noreset -ac -br -dpi 183 -screen 480x800x16 & 10CALLGRIND=${CALLGRIND}
11#Xephyr :1 -noreset -ac -br -dpi 183 -screen 800x480x16 & 11HOST_CURSOR=${HOST_CURSOR}
12#Xephyr :1 -noreset -ac -br -dpi 284 -screen 480x640x16 & 12TEST_HOME=${TEST_HOME}
13#Xephyr :1 -noreset -ac -br -dpi 284 -screen 640x480x16 -host-cursor & 13
14 14show_help()
15#Xephyr :1 -noreset -ac -br -dpi 183 -screen 960x400x16 -host-cursor & 15{
16 16 cat <<HELP_EOF
17#Xephyr :1 -noreset -ac -br -dpi 284 -screen 480x800 -host-cursor & 17Usage:
18#Xephyr :1 -noreset -ac -br -dpi 284 -screen 480x640 & 18
19#Xephyr :1 -noreset -ac -br -dpi 284 -screen 640x480 & 19 $0 [options]
20#Xephyr :1 -noreset -ac -br -dpi 181 -screen 320x320 & 20
21#Xephyr :1 -noreset -ac -br -dpi 186 -screen 272x480 & 21where options are:
22Xephyr :1 -noreset -ac -br -dpi 142 -screen 240x320 & 22
23#Xephyr :1 -noreset -ac -br -dpi 142 -screen 240x240 -host-cursor & 23 -c, --host-cursor Uses host-cursor, otherwise uses Xephyr's.
24 -d, --dpi=NUMBER states the dots-per-inch to be used.
25 -s, --screen=SPEC WIDTHxHEIGHT[xDEPTH] to be used.
26 -p, --profile=NAME Enlightenment profile name.
27 -e, --empty-home[=PATH] Run with \$HOME being a new, empty directory at /tmp
28
29
30Debugger options:
31
32 --valgrind=MODE Run under valgrind to check for memory problems.
33 Same value as enlightenment_start, mode is "OR" of:
34 1 = plain valgrind to catch crashes (default)
35 2 = trace children (thumbnailer, efm slaves, ...)
36 4 = check leak
37 8 = show reachable after processes finish.
38 all = all of above
39 --valgrind-log-file=FILENAME
40 Save valgrind log to file, see valgrind's
41 --log-file for details.
42 --massif Run under massif valgrind tool.
43 --callgrind Run under callgrind valgrind tool.
44
45
46Misc options:
47 -v, --verbose Be verbose about what is being done.
48 -h, --help Show this help.
49
50
51Useful or common options:
52
53 --dpi=142 --screen=240x320x16
54 --dpi=142 --screen=320x240x16
55 --dpi=186 --screen=272x480x16
56 --dpi=186 --screen=480x272x16
57 --dpi=181 --screen=320x320x16
58 --dpi=183 --screen=320x480x16 --host-cursor
59 --dpi=183 --screen=480x320x16 --host-cursor
60 --dpi=183 --screen=480x800x16
61 --dpi=183 --screen=800x480x16
62 --dpi=284 --screen=480x640x16
63 --dpi=284 --screen=640x480x16 --host-cursor
64 --dpi=183 --screen=960x400x16 --host-cursor
65 --dpi=284 --screen=480x800 --host-cursor
66 --dpi=284 --screen=480x640
67 --dpi=284 --screen=640x480
68 --dpi=181 --screen=320x320
69 --dpi=186 --screen=272x480
70 --dpi=142 --screen=240x320
71 --dpi=142 --screen=240x240 --host-cursor
72
73HELP_EOF
74}
75
76while [ $# -gt 0 ]; do
77 arg=$1
78 shift
79 option=`echo "'$arg'" | cut -d'=' -f1 | tr -d "'"`
80 value=`echo "'$arg'" | cut -d'=' -f2- | tr -d "'"`
81 if [ x"$value" = x"$option" ]; then
82 value=""
83 fi
84
85 case $option in
86 -h|-help|--help)
87 show_help
88 exit 0
89 ;;
90 -v|-verbose|--verbose)
91 VERBOSE=1
92 ;;
93 -e|-empty-home|--empty-home)
94 if [ -z "$value" ]; then
95 TEST_HOME="/tmp/e-test-${USER:-$UID}"
96 else
97 TEST_HOME="$value"
98 fi
99 ;;
100 -d|-dpi|--dpi)
101 if [ -z "$value" ]; then
102 value=$1
103 shift
104 fi
105 DPI=$value
106 ;;
107 -s|-screen|--screen)
108 if [ -z "$value" ]; then
109 value=$1
110 shift
111 fi
112 SCREEN=$value
113 ;;
114 -p|-profile|--profile)
115 if [ -z "$value" ]; then
116 value=$1
117 shift
118 fi
119 PROFILE=$value
120 ;;
121 -c|-host-cursor|--host-cursor)
122 HOST_CURSOR="-host-cursor"
123 ;;
124 -valgrind|--valgrind)
125 if [ -z "$value" ]; then
126 value=$1
127 shift
128 fi
129 VALGRIND=$value
130 ;;
131 -valgrind-log-file|--valgrind-log-file)
132 if [ -z "$value" ]; then
133 value=$1
134 shift
135 fi
136 VALGRIND_LOG_FILE=$value
137 ;;
138 -massif|--massif)
139 MASSIF="1"
140 ;;
141 -callgrind|--callgrind)
142 CALLGRIND="1"
143 ;;
144 *)
145 echo "Unknown option: $option" 1>&2
146 ;;
147 esac
148done
149
150debuggers=0
151
152if [ ! -z "$MASSIF" ]; then
153 DEBUGGER="-massif"
154 ((debuggers++))
155fi
156
157if [ ! -z "$CALLGRIND" ]; then
158 DEBUGGER="-callgrind"
159 ((debuggers++))
160fi
161
162if [ ! -z "$VALGRIND" ]; then
163 DEBUGGER="-valgrind=$VALGRIND"
164 ((debuggers++))
165fi
166
167if [ $debuggers -gt 1 ]; then
168 echo "WARNING: more than one debugger specified. Using $DEBUGGER" 1>&2
169fi
170
171if [ ! -z "$TEST_HOME" ]; then
172 if [ "${TEST_HOME#/tmp/}" != "$TEST_HOME" ]; then
173 # just delete if inside /tmp
174 rm -fr "$TEST_HOME/"
175 fi
176 mkdir -p "$TEST_HOME"
177fi
178
179unset E_RESTART E_START E_IPC_SOCKET E_START_TIME E_CONF_PROFILE
180
181if [ $VERBOSE -ne 0 ]; then
182 cat <<EOF
183Using:
184
185 DPI=$DPI
186 SCREEN=$SCREEN
187 PROFILE=$PROFILE
188 HOST_CURSOR=$HOST_CURSOR
189 DEBUGGER=$DEBUGGER
190 VALGRIND=$VALGRIND
191 VALGRIND_LOG_FILE=$VALGRIND_LOG_FILE
192 MASSIF=$MASSIF
193 CALLGRIND=$CALLGRIND
194 TEST_HOME=$TEST_HOME
195EOF
196 set -x
197fi
198
199Xephyr :1 -noreset -ac -br -dpi $DPI -screen $SCREEN $HOST_CURSOR &
24 200
25sleep 1 201sleep 1
26export DISPLAY=:1 202export DISPLAY=:1
27#export E_CONF_PROFILE=illume-home 203[ ! -z "$TEST_HOME" ] && export HOME="$TEST_HOME"
28#valgrind --db-attach=yes --leak-check=full --leak-resolution=high --num-callers=32 \
29#enlightenment \
30unset E_RESTART E_START E_IPC_SOCKET E_START_TIME E_CONF_PROFILE
31enlightenment_start \ 204enlightenment_start \
32-no-precache \ 205 -no-precache \
33-i-really-know-what-i-am-doing-and-accept-full-responsibility-for-it \ 206 -i-really-know-what-i-am-doing-and-accept-full-responsibility-for-it \
34-profile illume-home 207 -profile $PROFILE \
208 $DEBUGGER
35 209
36#-fake-xinerama-screen 480x400+0+0 \ 210#-fake-xinerama-screen 480x400+0+0 \
37#$-fake-xinerama-screen 480x400+480+0 211#$-fake-xinerama-screen 480x400+480+0