|
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 |
error() { |
| 5 |
echo "There was an error starting wmii." |
| 6 |
# if 1 parameter, then print all parameters. |
| 7 |
[ ! -z "$1" ] && echo "$@" |
| 8 |
exit 1 |
| 9 |
} |
| 10 |
|
| 4 |
wmiiwm -c || exit 1 |
11 |
wmiiwm -c || exit 1 |
| 5 |
|
12 |
|
| 6 |
OLD_PATH=$PATH export OLD_PATH |
13 |
OLD_PATH=$PATH export OLD_PATH |
| 7 |
PATH=$HOME/.wmii-3:CONFPREFIX/wmii-3:$PATH export PATH |
14 |
PATH=$HOME/.wmii-3:CONFPREFIX/wmii-3:$PATH export PATH |
| 8 |
WMII_ADDRESS=unix!/tmp/ns.$USER.${DISPLAY%.0}/wmii export WMII_ADDRESS |
15 |
WMII_ADDRESS=unix!/tmp/ns.$USER.${DISPLAY%.0}/wmii export WMII_ADDRESS |
| 9 |
|
16 |
|
| 10 |
mkdir -m 700 /tmp/ns.$USER.${DISPLAY%.0} 2>/dev/null |
17 |
# check to see if the namespace directory exists, and if so, that its permissions are okay |
|
|
18 |
WMII_NS_DIR="/tmp/ns.$USER.${DISPLAY%.0}" |
| 19 |
if [ -a ${WMII_NS_DIR} ]; then |
| 20 |
if [ -O ${WMII_NS_DIR} ]; then |
| 21 |
if ls -ld ${WMII_NS_DIR} | grep -vq "^drwx------"; then |
| 22 |
error "Your wmii namespace directory (${WMII_NS_DIR}) exists, but it is group or world readable/writable" |
| 23 |
fi |
| 24 |
else |
| 25 |
error "Your wmii namespace directory (${WMII_NS_DIR}) exists, but it is not owned by you." |
| 26 |
fi |
| 27 |
else |
| 28 |
mkdir -m 700 -p ${WMII_NS_DIR} || error "Your wmii namespace directory (${WMII_NS_DIR}) doesn't exist, and wmii cannot create it." |
| 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 & |