I needed to add the window argument to automatically focus a group
when a window was added to it, have been meaning to submit a patch but
wondered if there was a broader context that should also be handled:

diff --git a/libqtile/group.py b/libqtile/group.py
index e99b38b..aebc4d9 100644
--- a/libqtile/group.py
+++ b/libqtile/group.py
@@ -247,7 +247,7 @@ class _Group(command.CommandObject):
         )

     def add(self, win, focus=True):
-        hook.fire("group_window_add")
+        hook.fire("group_window_add", self, win)
         self.windows.add(win)
         win.group = self

...

On Tue, Sep 15, 2015 at 8:51 AM, Roger Duran <[email protected]> wrote:
> On Tue, Sep 15, 2015 at 7:58 AM, Alexander Koptelov
> <[email protected]> wrote:
>> Hi,
>>
>> As I see the subj hooks are mainly used for widgets so far and no-arg
>> version works perfectly there.
>>
>> I'm trying to move a window to a particular group as its title gets changed
>> instead of when it is created. And in this case I need a window object
>> passed to hook function for window_name_change event.
>>
>> What if we add the window argument to firing this event? And maybe other
>> window-related events?
>>
>> Also I was thinking about some additional hooking for Group configs, e.g.
>>
>> Group('name', matches=[Match(title='my title')],
>> hooks=['window_name_change'], ...)
>
> mm.. what about something like: match_on=['created', 'updated'] or
> match_on=When(created=True, updated=True) ?
>
>>
>> so when a title is changed to some specific value, the window will be
>> assigned to this group?
>>
>> Regards,
>> Alex
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "qtile-dev" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "qtile-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"qtile-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to