Re: [wmii] snap: 20060411

From: Anselm R. Garbe <garbeam_AT_wmii.de>
Date: Tue, 11 Apr 2006 12:28:38 +0200

On Tue, Apr 11, 2006 at 12:57:01PM +0300, Jani H. Lahtinen wrote:
> ext Anselm R. Garbe wrote:
> >To prevent any confusion, this only means that the view command
> >accepts only a single tag to be viewed. This does not mean, that
> >clients can have arbitrary tags.
> Not a terribly loss, but it is prettier as a concept when the view
> command is interpreted as "now I want to see all things that have a
> property X" instead of "now I want to go to look at the desktop X that I
> have constructed previously that contains things that I usually want to
> look at at the same time." The first is more dynamic is it not?
The feature to view several tags at once (e.g. xwrite /ctl view
1+2) is not less dynamic than viewing a single tag (e.g. xwrite
/ctl view foo). But the feature to view several tags at once is
redundant, because you could do:

--[addtag.sh]--
#!/bin/sh
# usage: `basename $0` <existing tag(s)> <append tag>
for i in `wmiir read /clients|awk '{print $10}'`
do
    if test `wmiir read /clients/$i/tags | grep -c $1` -gt 0
    then
        echo -n $1+$2 | wmiir write /clients/$i/tags
    fi
done

--
You could do:
addtag.sh 1 join
addtag.sh 2 join
echo -n view join | wmiir write /ctl
This is the same as doing view 1+2 before, but with an important
and useful difference: newly created clients which match against
! inherit the 'join' tag only.
To get rid of the join tag, you simply need a rmtag.sh script.
--[rmtag.sh]--
#!/bin/sh
# usage: `basename $0` <remove tag>
for i in `wmiir read /clients|awk '{print $10}'`
do
    t=`wmiir read /clients/$i/tags`;
    if test echo $t | grep -c $1` -gt 0 
    then
        echo $t | sed 's/+'$1'//; s/'$1'+//' | wmiir write /clients/$i/tags
    fi
done
--
Regards,
-- 
 Anselm R. Garbe  ><><  www.ebrag.de  ><><  GPG key: 0D73F361
Received on Tue Apr 11 2006 - 12:28:38 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 16:02:13 UTC