commit afa5c137c1f6df0b9cc8e9ee85c714c585ca5b87
parent cd607938f9046839df9e5026ae323c16534b2dfb
Author: Kris Maglione <jg@suckless.org>
Date: Sun, 11 Feb 2007 23:46:15 -0500
Replaced xwrite with `wmiir echo`
Diffstat:
| rc/wmiirc | | | 48 | +++++++++++++++++++++--------------------------- |
| wmiir | | | 13 | ++++++++++++- |
2 files changed, 33 insertions(+), 28 deletions(-)
diff --git a/rc/wmiirc b/rc/wmiirc
@@ -55,11 +55,6 @@ wmiir write /tagrules <<EOF
EOF
# FUNCTIONS
-xwrite() {
- file="$1"; shift
- echo -n "$@" | wmiir write "$file"
-}
-
proglist() {
ls -lL "$@" 2>/dev/null | awk 'NF>2 && $1 ~ /^[^d].*x/ {print $NF}' | sort | uniq
}
@@ -76,7 +71,6 @@ tagsmenu() {
wmiir ls /tag | sed "s|/||; /^sel\$/d" | $DMENU
}
-
# MISC
PROGS_FILE="$WMII_NS_DIR/.dmenu.proglist"
ACTIONS_DIRS=`echo "$WMII_CONFPATH" | tr : ' '`
@@ -171,59 +165,59 @@ do
wmiir remove "/lbar/$parms"
;;
FocusTag)
- xwrite "/lbar/$parms" "$WMII_FOCUSCOLORS" "$parms"
+ wmiir echo "/lbar/$parms" "$WMII_FOCUSCOLORS" "$parms"
;;
UnfocusTag)
- xwrite "/lbar/$parms" "$WMII_NORMCOLORS" "$parms"
+ wmiir echo "/lbar/$parms" "$WMII_NORMCOLORS" "$parms"
;;
LeftBarClick)
shift
- xwrite /ctl view "$@";;
+ wmiir echo /ctl view "$@";;
Key)
key="$1"
case "$key" in
$MODKEY-$LEFT)
- xwrite /tag/sel/ctl select left;;
+ wmiir echo /tag/sel/ctl select left;;
$MODKEY-$RIGHT)
- xwrite /tag/sel/ctl select right;;
+ wmiir echo /tag/sel/ctl select right;;
$MODKEY-$DOWN)
- xwrite /tag/sel/ctl select down;;
+ wmiir echo /tag/sel/ctl select down;;
$MODKEY-$UP)
- xwrite /tag/sel/ctl select up;;
+ wmiir echo /tag/sel/ctl select up;;
$MODKEY-space)
- xwrite /tag/sel/ctl select toggle;;
+ wmiir echo /tag/sel/ctl select toggle;;
$MODKEY-d)
- xwrite /tag/sel/ctl colmode sel default;;
+ wmiir echo /tag/sel/ctl colmode sel default;;
$MODKEY-s)
- xwrite /tag/sel/ctl colmode sel stack;;
+ wmiir echo /tag/sel/ctl colmode sel stack;;
$MODKEY-m)
- xwrite /tag/sel/ctl colmode sel max;;
+ wmiir echo /tag/sel/ctl colmode sel max;;
$MODKEY-a)
`conf_which "$(proglist $ACTIONS_DIRS | $DMENU)"` &;;
$MODKEY-p)
sh -c "`$DMENU <$PROGS_FILE`" &;;
$MODKEY-t)
- xwrite /ctl "view `tagsmenu`" &;;
+ wmiir echo /ctl "view `tagsmenu`" &;;
$MODKEY-[0-9])
- xwrite /ctl view "`echo $key | sed 's/.*-//'`";;
+ wmiir echo /ctl view "`echo $key | sed 's/.*-//'`";;
$MODKEY-Return)
$WMII_TERM &;;
$MODKEY-Shift-$LEFT)
- xwrite /tag/sel/ctl send sel left;;
+ wmiir echo /tag/sel/ctl send sel left;;
$MODKEY-Shift-$RIGHT)
- xwrite /tag/sel/ctl send sel right;;
+ wmiir echo /tag/sel/ctl send sel right;;
$MODKEY-Shift-$DOWN)
- xwrite /tag/sel/ctl send sel down;;
+ wmiir echo /tag/sel/ctl send sel down;;
$MODKEY-Shift-$UP)
- xwrite /tag/sel/ctl send sel up;;
+ wmiir echo /tag/sel/ctl send sel up;;
$MODKEY-Shift-space)
- xwrite /tag/sel/ctl send sel toggle;;
+ wmiir echo /tag/sel/ctl send sel toggle;;
$MODKEY-Shift-c)
- xwrite /client/sel/ctl kill;;
+ wmiir echo /client/sel/ctl kill;;
$MODKEY-Shift-t)
- xwrite "/client/`wmiir read /client/sel/ctl`/tags" "`tagsmenu`" &;;
+ wmiir echo "/client/`wmiir read /client/sel/ctl`/tags" "`tagsmenu`" &;;
$MODKEY-Shift-[0-9])
- xwrite /client/sel/tags "`echo $key | sed 's/.*-//'`";;
+ wmiir echo /client/sel/tags "`echo $key | sed 's/.*-//'`";;
esac;;
esac
done &
diff --git a/wmiir b/wmiir
@@ -1,2 +1,13 @@
#!/bin/sh
-exec ixpc -a "$WMII_ADDRESS" $@
+export IXP_ADDRESS="$WMII_ADDRESS"
+if [ "$1" = -v ]; then
+ flag=-v;
+ shift
+fi
+if [ "$1" = echo ]; then
+ shift
+ file="$1"; shift
+ echo "$@" | ixpc $flag write $file
+else
+ exec ixpc $flag $@
+fi