On Wed, 16 Feb 2005, Matthieu Moy wrote:
> Hi again,
>
> I can now use the scratchpad and start to like it.
>
> However, the lua interface is really limited, and I think the
> scratchpad could become a really great tool with a bit of
> scriptability:
>
> For example, I wanted to modify the function detach_topmost_transient
> of detach.lua to do something like
> detach_topmost_transient_and_send_it_to_scratchpad_and_show_scratchpad
> (maybe with a shorter name ;-).
>
> I'd like the scratchpad to export functions like
>
> bool is_active()
> WMPlex get_instance()
>
> I don't think I'll have time to get into the code and implement this,
> but I guess this shouldn't be too hard.
You can do this with things as they currently are, you'd just need to
ioncore.find_region the default WScratchpad (it's named WScratchpad) and
then attach the transient to that. WRegion.is_mapped and friends should
be enough to tell you whether the scratchpad is shown, and decide
whether you need to toggle it on.
Note the names above are pulled from memory because I am at work and
don't have ion here.
-Etan
P.S. Doing exactly what you asked for isn't such a good idea because in
ion svn you can have multiple scratchpads, so there can't be a general
is_active and find_instance (and besides that's what the
find_region/etc functions are for).