commit 3be23e96dde865a1741a8ede4de18a80e3c2be89
parent bae882dfeccfeaf64ca0ebb7a2b28be45aab440c
Author: Kris Maglione <jg@suckless.org>
Date: Fri, 30 Mar 2007 22:56:09 -0400
Fix wmiirc
Diffstat:
| rc/wmiirc.sh | | | 46 | ++++++++++++++++++++++++---------------------- |
1 file changed, 24 insertions(+), 22 deletions(-)
diff --git a/rc/wmiirc.sh b/rc/wmiirc.sh
@@ -161,6 +161,27 @@ grabmod $MODKEY
border 1
EOF
+# Feed events to `wmiiloop' for processing
+IFS=''
+eval $(eventstuff | sed "s/\\\$MODKEY/$MODKEY/g;s/^[ ]//" | wmiiloop)
+unset IFS
+
+# Functions
+Action() {
+ action=$1; shift
+ if [ -n "$action" ]; then
+ Action_$action $@ \
+ || conf_which $action $@
+ fi
+}
+
+proglist() {
+ paths=$(echo "$@" | sed 'y/:/ /')
+ ls -lL $paths 2>/dev/null \
+ | awk '$1 ~ /^[^d].*x/ { print $NF }' \
+ | sort | uniq
+}
+
# Misc
progsfile="$WMII_NS_DIR/.proglist"
Action status &
@@ -186,25 +207,11 @@ while read tag; do
fi
done
-# Functions
-Action() {
- action=$1; shift
- if [ -n "$action" ]; then
- Action_$action $@ \
- || conf_which $action $@
- fi
-}
-
+# More functions
tagsmenu() {
wmiir ls /tag | sed 's|/||; /^sel$/d' | $WMII_MENU
}
-proglist() {
- paths=$(echo "$@" | sed 'y/:/ /')
- ls -lL $paths 2>/dev/null \
- | awk '$1 ~ /^[^d].*x/ { print $NF }' \
- | sort | uniq
-}
actionlist() {
{ proglist $WMII_CONFPATH
echo -n $Actions | tr ' ' '\012'
@@ -220,11 +227,6 @@ conf_which() {
fi
}
-# Feed events to `wmiiloop' for processing
-IFS=''
-eval $(eventstuff | sed "s/\\\$MODKEY/$MODKEY/g;s/^[ ]//" | wmiiloop)
-unset IFS
-
# Stop any running instances of wmiirc
echo Start wmiirc | wmiir write /event || exit 1
@@ -232,5 +234,5 @@ wmiir read /event |
while read event; do
set -- $event
event=$1; shift
- Event_$event $@ 2>/dev/null
-done
+ Event_$event $@
+done 2>/dev/null