public
Description: personal scripts
Homepage:
Clone URL: git://github.com/mackstann/bin.git
bin / startx
100755 31 lines (22 sloc) 0.519 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh
 
# Written by Nick Welch <nick@incise.org>. Author disclaims copyright.
 
# USAGE: startx [:display]
 
DISPLAY=:0
test -z "$1" || DISPLAY=$1
export DISPLAY
 
ERRORLOG="$HOME/.my-x-errors-$DISPLAY"
 
X -br -noreset "$DISPLAY" > "$ERRORLOG" 2>&1 &
 
# try a bunch of times until X is there
for try in `seq 10`
do
if xdpyinfo >/dev/null 2>&1
    then
exec >> "$ERRORLOG" 2>&1
        xstartup.sh
        exit 0
    else
sleep 0.5
    fi
done
 
echo "Couldn't connect to display $DISPLAY."
exit 1