Changed wmiir echo to wmiir xwrite, removed xwrite() from rc/status, and cleaned up wmiir script

This commit is contained in:
Kris Maglione 2007-02-13 00:41:18 -05:00
parent 47f21273e3
commit 293e90cc00
3 changed files with 27 additions and 34 deletions

View File

@ -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

View File

@ -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 &

8
wmiir
View File

@ -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 $@