commit ce4bc3ae92b076d65fdbb5de23d94715f664ae43
parent 1094d3e3af7e7bc51bec8bc9e66583d6de6a8f15
Author: Anselm R. Garbe <garbeam@wmii.de>
Date: Sun, 12 Mar 2006 10:16:04 +0100
wmiirc needs the pidfile mechanism, otherwise running wmiirc from other sources than a shortcut won't work
Diffstat:
2 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/cmd/wm/wmii b/cmd/wm/wmii
@@ -8,6 +8,8 @@ PATH=$HOME/.wmii-3:CONFPREFIX/wmii-3:$PATH export PATH
WMII_ADDRESS=unix!/tmp/ns.$USER.$DISPLAY/wmii export WMII_ADDRESS
mkdir -m 700 /tmp/ns.$USER.$DISPLAY 2>/dev/null
+wmiiwm -a $WMII_ADDRESS &
+wmiiwmpid=$!
mkdir $HOME/.wmii-3 2>/dev/null && welcome &
wmiirc &
-exec wmiiwm -a $WMII_ADDRESS
+wait $wmiiwmpid
diff --git a/rc/wmiirc b/rc/wmiirc
@@ -1,11 +1,6 @@
#!/bin/sh
# configure wmii
-# give wmiiwm a chance to start
-while ! wmiir read / > /dev/null 2>&1; do
-:
-done
-
xwrite() {
file="$1"; shift
echo -n "$@" | wmiir write "$file"
@@ -21,6 +16,15 @@ proglist() {
done | sort | uniq
}
+pidfile=/tmp/ns.$USER.$DISPLAY/wmiircpid
+test -f $pidfile && kill `cat $pidfile` 2>/dev/null
+echo $$ >$pidfile
+
+# give wmiiwm a chance to start
+while ! wmiir read / > /dev/null 2>&1; do
+ sleep 1
+done
+
MODKEY=Alt
WMII_FONT='fixed' export WMII_FONT
WMII_NORMCOLORS='#222222 #eeeeee #666666' export WMII_NORMCOLORS
@@ -168,3 +172,4 @@ do
esac;;
esac
done &
+echo $! >$pidfile