[hackers] [wmii] Replaced xwrite with `wmiir echo`

From: Kris Maglione <jg_AT_suckless.org>
Date: Mon Feb 12 05:46:40 2007

changeset: 1851:3f2435112d5d
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Sun Feb 11 23:46:15 2007 -0500
summary: Replaced xwrite with `wmiir echo`

diff -r 51442e2e67fc -r 3f2435112d5d rc/wmiirc
--- a/rc/wmiirc Sun Feb 11 23:24:11 2007 -0500
+++ b/rc/wmiirc Sun Feb 11 23:46:15 2007 -0500
@@ -55,11 +55,6 @@ 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
 }
@@ -75,7 +70,6 @@ tagsmenu() {
         tag=`wmiir read /tag/sel/ctl`
         wmiir ls /tag | sed "s|/||; /^sel\$/d" | $DMENU
 }
-
 
 # MISC
 PROGS_FILE="$WMII_NS_DIR/.dmenu.proglist"
@@ -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 -r 51442e2e67fc -r 3f2435112d5d wmiir
--- a/wmiir Sun Feb 11 23:24:11 2007 -0500
+++ b/wmiir Sun Feb 11 23:46:15 2007 -0500
@@ -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
Received on Mon Feb 12 2007 - 05:46:40 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:55:12 UTC