I am honestly not sure if there is an easier, cleaner way to achieve what 
you are after, but I am doing this manually using the following hook. 
"focus_on_window_activation" is set to "smart":

@hook.subscribe.client_new
def modify_window(client):
if (client.window.get_wm_transient_for() or client.window.get_wm_type() in 
floating_types):
client.floating = True

for group in groups: # follow on auto-move
match = next((m for m in group.matches if m.compare(client)), None)
if match:
targetgroup = client.qtile.groups_map[group.name] # there can be multiple 
instances of a group
targetgroup.cmd_toscreen(toggle=False)
break

The first two lines in that function only serve to take care of floating 
windows, you might already have that taken care of somewhere. My groups are 
publicly available in a list.
>From my experience this works perfectly; you could even exempt certain 
groups (or windows, although that would be a little uglier) from moving 
focus to automatically.



On Monday, 8 June 2020 02:06:53 UTC+2, Marco Obaid wrote:
>
> Guillaume, do you or the DEV team have a suggestion on how to overcome 
> this problem? We release a Qtile ISO for our Arcolinux users and our users 
> have been asking for this functionality.  Thanks
>
> On Fri, May 29, 2020 at 1:43 PM Marco Obaid <[email protected] 
> <javascript:>> wrote:
>
>> I tested this on 0.15.1 and 0.14.2 with the same result stated below.
>>
>> On Fri, May 29, 2020 at 1:40 PM Guillaume Gelin <[email protected] 
>> <javascript:>> wrote:
>>
>>> What version / commit of Qtile are you using?
>>>
>>> Le ven. 29 mai 2020 à 20:38, Marco Obaid <[email protected] 
>>> <javascript:>> a écrit :
>>>
>>>> I am trying to assign specific applications to open only in 
>>>> specific groups. Reading the documentation, I came across "Group Matches". 
>>>> I defined it in my config.py as stated below. For the most part it is 
>>>> working well. The application defined in the example below do open only in 
>>>> their assigned group. The only issue that I am trying to overcome is that 
>>>> "focus" does not automatically shift to the targeted group when I launch 
>>>> an 
>>>> application that is defined in the Match list below. For example, if I am 
>>>> in group 1  and launch Termite, which is assigned group 3. Termite WILL 
>>>> open in group 3, however, I have to switch the group manually from 1 to 3 
>>>> to start using Termite. The odd thing is that this is not happening to 
>>>> Sublime Text. If I am in any group, other than group 2 (defined for 
>>>> Sublime), two things will happen: 1) Sublime Text will open in group 2, 
>>>> AND, the focus is shifted to group 2 (which is the desired behavior). I 
>>>> have played around with "focus_on_window_activation" but it did not make a 
>>>> difference (value of "focus" seems to be the best settings). 
>>>>
>>>> Any suggestion? Is this a possible bug?
>>>>
>>>> group_matches = [
>>>>     #Group 1
>>>>     [Match(wm_class=["vivaldi-stable", "Vivaldi-stable", ])],
>>>>     #Group 2
>>>>     [Match(wm_class=["subl3", "Subl3", ])],
>>>>     #Group 3
>>>>     [Match(wm_class=["termite", "Termite", "urxvt", "URxvt", ])],
>>>>     #Group 4
>>>>     None, #[Match(wm_class=["Firefox", "firefox", "Navigator", ])],
>>>>     #Group 5
>>>>     None,
>>>>     #Group 6
>>>>     [Match(wm_class=["pragha", "Pragha", ])],
>>>>     #Group 7
>>>>     [Match(wm_class=["VirtualBox Manager", ])],
>>>>     #Group 8 
>>>>     [Match(wm_class=["thunar", "Thunar", ])],
>>>>     #Group 9  
>>>>     None,
>>>>     #Group 0
>>>>     [Match(wm_class=["discord", ])],
>>>> ]
>>>>
>>>> for i in range(len(group_names)):
>>>>     groups.append(
>>>>         Group(
>>>>             name=group_names[i],
>>>>             layout=group_layouts[i].lower(),
>>>>             label=group_labels[i],
>>>>             matches=group_matches[i],
>>>>        exclusive=group_exclusives[i],
>>>>             persist=group_persists[i],
>>>>             init=group_inits[i],
>>>>             #####spawn=group_spawns,
>>>>         ))
>>>>
>>>> .
>>>> .
>>>> .
>>>>
>>>> focus_on_window_activation = "focus" # or smart
>>>>
>>>>
>>>>
>>>> -- 
>>>> 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] <javascript:>.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/qtile-dev/CABZGO-qhDX3O19J8fsTwX9mRgf64vLRW4DFx64caZxOBrabjcQ%40mail.gmail.com
>>>>  
>>>> <https://groups.google.com/d/msgid/qtile-dev/CABZGO-qhDX3O19J8fsTwX9mRgf64vLRW4DFx64caZxOBrabjcQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>>
>>>
>>> -- 
>>> Guillaume Gelin
>>>
>>> -- 
>>> 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] <javascript:>.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/qtile-dev/CAPn4x%2Boc3iRvu-9%2B%2BVm5LrWzcA-LWiV1qQO6nNmTvaRfZdw2sQ%40mail.gmail.com
>>>  
>>> <https://groups.google.com/d/msgid/qtile-dev/CAPn4x%2Boc3iRvu-9%2B%2BVm5LrWzcA-LWiV1qQO6nNmTvaRfZdw2sQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> -- 
>> 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] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/qtile-dev/CABZGO-q-aR8_MdS2H7Li8aO9Mz_rJ9aaiOtNKuKrnCDA3e0vYg%40mail.gmail.com
>>  
>> <https://groups.google.com/d/msgid/qtile-dev/CABZGO-q-aR8_MdS2H7Li8aO9Mz_rJ9aaiOtNKuKrnCDA3e0vYg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qtile-dev/55e47936-9bfe-4d6b-a4c2-4d1cea5ec462o%40googlegroups.com.

Reply via email to