Create Action_ functions immediately. Quote $WMII_NORMCOLORS in Action_status

This commit is contained in:
Kris Maglione 2007-02-25 14:59:32 -05:00
parent 59fe492d74
commit 6aa67b638b
2 changed files with 9 additions and 10 deletions

View File

@ -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

View File

@ -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]+", "")