Re: [dev] [wmii] Between tiling and floating

From: LuX <lux.onthenet_AT_free.fr>
Date: Mon, 2 Aug 2010 00:12:01 +0200

Hello!

> Message de Kris Maglione: lun. 26/07/10, 19:46:43 -0400
> Event AreaFocus if wi_seltag | grep $master_tags >/dev/null; then
> export area=$1
> width=$(wmiir read /tag/sel/index | awk '$2 == ENVIRON["area"] { print $4; exit }')
> delta=$(($master_width - $width))
> if [ $area = 1 ]; then dir=right; else dir=left; done
> wmiir write /tag/sel/ctl grow sel sel $dir ${width}px
> fi

Well, I found (some of) the problems I had with these commands, and
some fixes. However there was still an odd behaviour, for example when
there are 3 columns, the two first of which have minimal width. Then
col 1 cannot grow to right because col 2 has minimal width, and col 2
cannot grow to left because col 1 has minimal width.

Although not perfect, the following commands give a better result.
They can certainly be improved.

master_width=800

---
Event AreaFocus
    area=$1
    for dir in left right; do
        width=$(wmiir read /tag/sel/index | awk '$2 == '$area' { print $4 }')
        delta=$(($master_width - $width))
        wmiir xwrite /tag/sel/ctl grow sel sel $dir ${delta}px
    done
Thanks again for your help, 
LuX. 
Received on Mon Aug 02 2010 - 00:12:01 CEST

This archive was generated by hypermail 2.2.0 : Mon Aug 02 2010 - 00:24:02 CEST