--- wmii-3.1/cmd/wm/wmii 2006-06-17 07:44:30.000000000 -0400 +++ wmii-3.1/cmd/wm/wmii 2006-06-23 12:45:44.000000000 -0400 @@ -1,13 +1,33 @@ #!/bin/sh # start wmiiwm and wait for its termination +error() { + echo "There was an error starting wmii." + # if 1 parameter, then print all parameters. + [ ! -z "$1" ] && echo "$@" + exit 1 +} + wmiiwm -c || exit 1 OLD_PATH=$PATH export OLD_PATH PATH=$HOME/.wmii-3:CONFPREFIX/wmii-3:$PATH export PATH WMII_ADDRESS=unix!/tmp/ns.$USER.${DISPLAY%.0}/wmii export WMII_ADDRESS -mkdir -m 700 /tmp/ns.$USER.${DISPLAY%.0} 2>/dev/null +# check to see if the namespace directory exists, and if so, that its permissions are okay +WMII_NS_DIR="/tmp/ns.$USER.${DISPLAY%.0}" +if [ -a ${WMII_NS_DIR} ]; then + if [ -O ${WMII_NS_DIR} ]; then + if ls -ld ${WMII_NS_DIR} | grep -vq "^drwx------"; then + error "Your wmii namespace directory (${WMII_NS_DIR}) exists, but it is group or world readable/writable" + fi + else + error "Your wmii namespace directory (${WMII_NS_DIR}) exists, but it is not owned by you." + fi +else + mkdir -m 700 -p ${WMII_NS_DIR} || error "Your wmii namespace directory (${WMII_NS_DIR}) doesn't exist, and wmii cannot create it." +fi + wmiiwm -a $WMII_ADDRESS & wmiiwmpid=$! mkdir $HOME/.wmii-3 2>/dev/null && welcome &