Lines 1-13
Link Here
|
1 |
#!/bin/sh |
1 |
#!/bin/sh |
2 |
# start wmiiwm and wait for its termination |
2 |
# start wmiiwm and wait for its termination |
3 |
|
3 |
|
|
|
4 |
startup_error() { |
5 |
echo "There was an error starting wmii." |
6 |
[ ! -z "$1" ] && echo "$1" |
7 |
exit 1 |
8 |
} |
9 |
|
4 |
wmiiwm -c || exit 1 |
10 |
wmiiwm -c || exit 1 |
5 |
|
11 |
|
6 |
OLD_PATH=$PATH export OLD_PATH |
12 |
OLD_PATH=$PATH export OLD_PATH |
7 |
PATH=$HOME/.wmii-3:CONFPREFIX/wmii-3:$PATH export PATH |
13 |
PATH=$HOME/.wmii-3:CONFPREFIX/wmii-3:$PATH export PATH |
8 |
WMII_ADDRESS=unix!/tmp/ns.$USER.${DISPLAY%.0}/wmii export WMII_ADDRESS |
14 |
WMII_ADDRESS=unix!/tmp/ns.$USER.${DISPLAY%.0}/wmii export WMII_ADDRESS |
9 |
|
15 |
|
10 |
mkdir -m 700 /tmp/ns.$USER.${DISPLAY%.0} 2>/dev/null |
16 |
# check to see if the directory exists, and if so, that its permissions are okay |
|
|
17 |
WMII_TMP_DIR="/tmp/ns.$USER.${DISPLAY%.0}" |
18 |
if [ -a ${WMII_TMP_DIR} ]; then |
19 |
if [ -O ${WMII_TMP_DIR} ] && [ -G ${WMII_TMP_DIR} ]; then |
20 |
perms=$(ls -ld ${WMII_TMP_DIR} | sed -e 's/\s.*$//') |
21 |
if [ "$perms" != "drwx------" ]; then |
22 |
startup_error "The wmii tmp directory ${WMII_TMP_DIR} exists, but its permissions are not the correct mode." |
23 |
fi |
24 |
else |
25 |
startup_error "The wmii tmp directory ${WMII_TMP_DIR} exists, but it is not owned by you." |
26 |
fi |
27 |
else |
28 |
mkdir -m 700 ${WMII_TMP_DIR} 2>/dev/null |
29 |
fi |
30 |
|
11 |
wmiiwm -a $WMII_ADDRESS & |
31 |
wmiiwm -a $WMII_ADDRESS & |
12 |
wmiiwmpid=$! |
32 |
wmiiwmpid=$! |
13 |
mkdir $HOME/.wmii-3 2>/dev/null && welcome & |
33 |
mkdir $HOME/.wmii-3 2>/dev/null && welcome & |