Re: scripting winprop extension

[email protected] Sat, 08 Aug 2009 18:00:31 +0200
Newsgroups gmane.comp.window-managers.ion.general
Message-ID <[email protected]>
Yes, something like that, but I'm not sure if you can define arbitrary
winprops. Also You can simpy do cwin:rqgeom({x=prop.position.x,  
y=prop.position.y})

- Ole Jørgen Brønner

On Sat, 08 Aug 2009 15:05:17 +0200, Maximilian W. Zeller
<[email protected]> wrote:

> hi again
>
> i am not quite familiar with lua but think it must be something like
> the following to extend winprop by the option position. I don't know
> how to make ion3 use this file. Is it enough to just put it in the
> ~/.ion3 folder? And as i said i don't know if this is how its done. I
> got these functions from the documentation but i am not sure if i used
> them right.
>
> -- usage:
> -- defwinprop {
> --    class = "something"
> --    instance = "anything"
> --    float = true
> --    position = { x = 100, y = 100 }
> -- }
>
> windowpos = {}
>
> function windowpos.set (cwin, tab) {
>
>         local prop = ioncore.get_winprop(cwin)
>         if prop and prop.float and prop.position then
>
>                 local horizmul = prop.position.x
>                 local vertmul = prop.position.y
>
>                 WFloatFrame.begin_resize(cwin)
>                 WFloatFrame.do_move(cwin, horizmul, vertmul)
>                 WFloatFrame.end_resize(cwin)
>
>                 return true
>
>         end
>
>         return false
> }
>
> ioncore.get_hook("clientwin_do_manage_alt"):add(windowpos.set)