On Tuesday, December 21, 2021 at 9:01:26 PM UTC-5 James Wright wrote:

> Yep. You'll want to use a trigger decorator for when a window is opened. 
> That should give the window as an argument. 
>
> That would probably be client_new 
<http://docs.qtile.org/en/latest/manual/ref/hooks.html#libqtile.hook.subscribe.client_new>
 (though 
possibly client_managed; I'm not sure when the move

> You can either use a match group to determine if the app is what you want 
> it to be. 
>
This would be "matchobj.compare(windowobj)", which would return a bool.
 

> If it is, the window should have a method for moving the window to a 
> specific location on the screen (assuming this is a floating window). 
>
For the Wayland backend, looks like there's a method called "place" that 
should do the trick. But there's also "_tweak_float" that is a bit simpler. 
The leading underscore means it's not supposed to be a public method, so it 
might break in the future.
 

> I don't remember if that method uses absolute coordinates or 
> monitor-relative coordinates. 
>
Looks like "place" is screen relative from this 
<https://github.com/qtile/qtile/blob/9e8f9b7d8d28f16e002c83f319da62d9d9ba9f91/libqtile/backend/wayland/window.py#L509-L511>.
 
But "_tweak_float" is absolute 
<https://github.com/qtile/qtile/blob/9e8f9b7d8d28f16e002c83f319da62d9d9ba9f91/libqtile/backend/wayland/window.py#L528-L556>
.

So in the end, it'd look something like this:

@subscribe.client_new
def set_App_location(window):
    if matchobj.compare(window):
        window._tweak_float(x=420, y=69)
 

> That concept may not even exist on Wayland, I'm fairly in familiar with it.
>
> I can try to track down the actual function names in a bit, but hopefully 
> that should get you going in the right direction.
>
> On Tue, Dec 21, 2021, 17:59 Justine Smithies <[email protected]> wrote:
>
>> Is there a way to say open mpv or any app with a certain class or title 
>> at a specific location on screen and size ?
>>
>> Thanks in advance
>>
>> -- 
>> 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/CADrRWNbhtptaUUw0AmRmZVrKRFxNBoN9BSA%3D-geyFwYR2Nwspw%40mail.gmail.com
>>  
>> <https://groups.google.com/d/msgid/qtile-dev/CADrRWNbhtptaUUw0AmRmZVrKRFxNBoN9BSA%3D-geyFwYR2Nwspw%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/ce57d7f6-a37a-4e11-b8e1-efde1e2a577dn%40googlegroups.com.

Reply via email to