[hackers] [wmii] Changed `wmiir echo` to `wmiir xwrite`, removed xwrite() from rc/status, and cleaned up wmiir script

From: Kris Maglione <jg_AT_suckless.org>
Date: Tue Feb 13 06:42:40 2007

changeset: 1863:905d1da6f704
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Tue Feb 13 00:41:18 2007 -0500
summary: Changed `wmiir echo` to `wmiir xwrite`, removed xwrite() from rc/status, and cleaned up wmiir script

diff -r 580a986d9359 -r 905d1da6f704 rc/status
--- a/rc/status Mon Feb 12 23:35:43 2007 -0500
+++ b/rc/status Tue Feb 13 00:41:18 2007 -0500
@@ -1,14 +1,9 @@
 #!/bin/sh
 # periodically print date and load average to the bar
 
-xwrite() {
- file="$1"; shift
- echo -n "$@" | wmiir write "$file"
-}
-
 wmiir remove /rbar/status 2>/dev/null && sleep 2
 echo $WMII_SELCOLORS | wmiir create /rbar/status
-while xwrite /rbar/status "$WMII_NORMCOLORS" `date` `uptime | sed 's/.*://; s/,//g'`
+while wmiir xwrite /rbar/status "$WMII_NORMCOLORS" `date` `uptime | sed 's/.*://; s/,//g'`
 do
         sleep 1
 done
diff -r 580a986d9359 -r 905d1da6f704 rc/wmiirc
--- a/rc/wmiirc Mon Feb 12 23:35:43 2007 -0500
+++ b/rc/wmiirc Tue Feb 13 00:41:18 2007 -0500
@@ -165,67 +165,67 @@ do
                 wmiir remove "/lbar/$parms"
                 ;;
         FocusTag)
- wmiir echo "/lbar/$parms" "$WMII_FOCUSCOLORS" "$parms"
+ wmiir xwrite "/lbar/$parms" "$WMII_FOCUSCOLORS" "$parms"
                 ;;
         UnfocusTag)
- wmiir echo "/lbar/$parms" "$WMII_NORMCOLORS" "$parms"
+ wmiir xwrite "/lbar/$parms" "$WMII_NORMCOLORS" "$parms"
                 ;;
         UrgentTag)
                 shift
- wmiir echo "/lbar/$@" "*$@"
+ wmiir xwrite "/lbar/$@" "*$@"
                 ;;
         NotUrgentTag)
                 shift
- wmiir echo "/lbar/$@" "$@"
+ wmiir xwrite "/lbar/$@" "$@"
                 ;;
         LeftBarClick)
                 shift
- wmiir echo /ctl view "$@";;
+ wmiir xwrite /ctl view "$@";;
         Key)
                 key="$1"
                 case "$key" in
                 $MODKEY-$LEFT)
- wmiir echo /tag/sel/ctl select left;;
+ wmiir xwrite /tag/sel/ctl select left;;
                 $MODKEY-$RIGHT)
- wmiir echo /tag/sel/ctl select right;;
+ wmiir xwrite /tag/sel/ctl select right;;
                 $MODKEY-$DOWN)
- wmiir echo /tag/sel/ctl select down;;
+ wmiir xwrite /tag/sel/ctl select down;;
                 $MODKEY-$UP)
- wmiir echo /tag/sel/ctl select up;;
+ wmiir xwrite /tag/sel/ctl select up;;
                 $MODKEY-space)
- wmiir echo /tag/sel/ctl select toggle;;
+ wmiir xwrite /tag/sel/ctl select toggle;;
                 $MODKEY-d)
- wmiir echo /tag/sel/ctl colmode sel default;;
+ wmiir xwrite /tag/sel/ctl colmode sel default;;
                 $MODKEY-s)
- wmiir echo /tag/sel/ctl colmode sel stack;;
+ wmiir xwrite /tag/sel/ctl colmode sel stack;;
                 $MODKEY-m)
- wmiir echo /tag/sel/ctl colmode sel max;;
+ wmiir xwrite /tag/sel/ctl colmode sel max;;
                 $MODKEY-a)
                         `conf_which "$(proglist $ACTIONS_DIRS | $DMENU)"` &;;
                 $MODKEY-p)
                         sh -c "`$DMENU <$PROGS_FILE`" &;;
                 $MODKEY-t)
- wmiir echo /ctl "view `tagsmenu`" &;;
+ wmiir xwrite /ctl "view `tagsmenu`" &;;
                 $MODKEY-[0-9])
- wmiir echo /ctl view "`echo $key | sed 's/.*-//'`";;
+ wmiir xwrite /ctl view "`echo $key | sed 's/.*-//'`";;
                 $MODKEY-Return)
                         $WMII_TERM &;;
                 $MODKEY-Shift-$LEFT)
- wmiir echo /tag/sel/ctl send sel left;;
+ wmiir xwrite /tag/sel/ctl send sel left;;
                 $MODKEY-Shift-$RIGHT)
- wmiir echo /tag/sel/ctl send sel right;;
+ wmiir xwrite /tag/sel/ctl send sel right;;
                 $MODKEY-Shift-$DOWN)
- wmiir echo /tag/sel/ctl send sel down;;
+ wmiir xwrite /tag/sel/ctl send sel down;;
                 $MODKEY-Shift-$UP)
- wmiir echo /tag/sel/ctl send sel up;;
+ wmiir xwrite /tag/sel/ctl send sel up;;
                 $MODKEY-Shift-space)
- wmiir echo /tag/sel/ctl send sel toggle;;
+ wmiir xwrite /tag/sel/ctl send sel toggle;;
                 $MODKEY-Shift-c)
- wmiir echo /client/sel/ctl kill;;
+ wmiir xwrite /client/sel/ctl kill;;
                 $MODKEY-Shift-t)
- wmiir echo "/client/`wmiir read /client/sel/ctl`/tags" "`tagsmenu`" &;;
+ wmiir xwrite "/client/`wmiir read /client/sel/ctl`/tags" "`tagsmenu`" &;;
                 $MODKEY-Shift-[0-9])
- wmiir echo /client/sel/tags "`echo $key | sed 's/.*-//'`";;
+ wmiir xwrite /client/sel/tags "`echo $key | sed 's/.*-//'`";;
                 esac;;
         esac
 done &
diff -r 580a986d9359 -r 905d1da6f704 wmiir
--- a/wmiir Mon Feb 12 23:35:43 2007 -0500
+++ b/wmiir Tue Feb 13 00:41:18 2007 -0500
@@ -1,12 +1,10 @@
 #!/bin/sh
 export IXP_ADDRESS="$WMII_ADDRESS"
 if [ "$1" = -v ]; then
- flag=-v;
- shift
+ flag=-v; shift
 fi
-if [ "$1" = echo ]; then
- shift
- file="$1"; shift
+if [ "$1" = xwrite ]; then
+ file="$2"; shift 2
         echo "$@" | ixpc $flag write $file
 else
         exec ixpc $flag $@
Received on Tue Feb 13 2007 - 06:42:40 UTC

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