commit 6aa67b638b09dc33eb0be19ce010b3ef69586781
parent 59fe492d7493888f533593e27226c70a1d26801f
Author: Kris Maglione <jg@suckless.org>
Date: Sun, 25 Feb 2007 14:59:32 -0500
Create Action_ functions immediately. Quote $WMII_NORMCOLORS in Action_status
Diffstat:
2 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/rc/wmiirc b/rc/wmiirc
@@ -72,7 +72,7 @@ Action status
if wmiir remove /rbar/status 2>/dev/null; then
sleep 2
fi
- echo $WMII_NORMCOLORS | wmiir create /rbar/status
+ echo "$WMII_NORMCOLORS" | wmiir create /rbar/status
while status | wmiir write /rbar/status; do
sleep 1
done
@@ -142,7 +142,7 @@ actionlist() {
}
conf_which () {
- echo \$(PATH="$WMII_CONFPATH:$PATH" which \$1) "\$@"
+ echo \$({export PATH="$WMII_CONFPATH:$PATH"; which \$1}) "\$@"
}
tagsmenu() {
@@ -194,4 +194,4 @@ done
# Stop any running instances of wmiirc
echo Start wmiirc | wmiir write /event || exit 1
-} | wmiiloop | tee /dev/fd/2 | sh
+} | wmiiloop | sh
diff --git a/wmiiloop b/wmiiloop
@@ -10,6 +10,7 @@ BEGIN {
arg[1] = "Nop"
writekeys = "wmiir write /keys"
readevent = "wmiir read /event"
+ print "ACTIONS=\"\""
}
function addevent() {
@@ -20,7 +21,11 @@ function addevent() {
events[arg[2]] = body
}
else if(arg[1] == "Action") {
- actions[arg[2]] = body
+ action = arg[2];
+ actions[action] = body
+ gsub("\"", "\\\"", action)
+ print "ACTIONS=\"$ACTIONS\n" action "\""
+ print "Action_" action "() {" actions[action] "\n}"
}
}
@@ -37,12 +42,6 @@ END {
for(key in keys)
print key | writekeys
close(writekeys)
- print "ACTIONS=\"\""
- for(action in actions) {
- gsub("\"", "\\\"", action)
- print "ACTIONS=\"$ACTIONS\n" action "\""
- print "Action_" action "() {" actions[action] "\n}"
- }
while(readevent | getline) {
split($0, arg)
sub("^[a-zA-Z]+[ \t]+", "")