Replaced xwrite with `wmiir echo`

This commit is contained in:
Kris Maglione 2007-02-11 23:46:15 -05:00
parent cd607938f9
commit afa5c137c1
2 changed files with 33 additions and 28 deletions

View File

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

13
wmiir
View File

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