commit 8a4f6e01e65e2729b4f126b6f2842143af9ce25c
parent b89b7df7e87ac7096356be227d0936ad7182a533
Author: Kris Maglione <jg@suckless.org>
Date: Wed, 7 Mar 2007 16:08:19 -0500
Fix wmiirc in shells with POSIX emulation modes.
Diffstat:
2 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/rc/wmiirc b/rc/wmiirc
@@ -43,9 +43,8 @@ status() {
echo -n $(uptime | sed 's/.*://; s/,//g') '|' $(date)
}
-IFS=''
-eval $({
-cat <<'EOF'
+eventstuff() {
+ cat <<'EOF'
# Events
Event Start
case "$1" in
@@ -98,7 +97,7 @@ Event ClientMouseDown
menulast=${do:-"$menulast"}
esac
EOF
-cat <<EOF
+ cat <<EOF
# Key Bindings
Key $MODKEY-$LEFT
wmiir xwrite /tag/sel/ctl select left
@@ -139,15 +138,18 @@ Key $MODKEY-Shift-c
Key $MODKEY-Shift-t
wmiir xwrite "/client/\$(wmiir read /client/sel/ctl)/tags" "\$(tagsmenu)" &
EOF
-for i in 0 1 2 3 4 5 6 7 8 9; do
- cat << EOF
+ for i in 0 1 2 3 4 5 6 7 8 9; do
+ cat << EOF
Key $MODKEY-$i
wmiir xwrite /ctl view "$i"
Key $MODKEY-Shift-$i
wmiir xwrite /client/sel/tags "$i"
EOF
-done
-} | wmiiloop)
+ done
+}
+
+IFS=''
+eval $(eventstuff | wmiiloop)
unset IFS
# Functions
diff --git a/wmiiloop b/wmiiloop
@@ -1,6 +1,7 @@
#!AWKPATH -f
BEGIN {
arg[1] = "Nop"
+ body = "";
writekeys = "wmiir write /keys"
print "IFS=''"
}
@@ -13,7 +14,8 @@ function addevent() {
print var "=\"$" var " " arg[2] "\""
gsub("[^a-zA-Z_0-9]", "_", arg[2]);
- print arg[1] "_" arg[2] "() {" body "\n}"
+ if(body != "")
+ print arg[1] "_" arg[2] "() {" body "\n}"
}
/^(Event|Key|Action)[ \t]/ {