<!DOCTYPE html><html><head><title></title><style type="text/css">p.MsoNormal,p.MsoNoSpacing{margin:0}</style></head><body><div>Hi Dave,<br></div><div><br></div><div>I don't think there's a standard API for this, so you may need to figure it out for each desktop & window manager separately.<br></div><div><br></div><div>For Gnome, it looks like most of what you want is not available by default, but there's an extension that provides extra D-Bus methods:<br></div><div><a href="https://askubuntu.com/questions/1441664/how-do-i-move-maximize-activate-desktop-windows-using-dbus-in-terminal">https://askubuntu.com/questions/1441664/how-do-i-move-maximize-activate-desktop-windows-using-dbus-in-terminal</a><br></div><div><br></div><div>Some bits (like the list of open windows) are present in Gnome's D-Bus API, but normally blocked by a security setting. It's possible to enable an 'unsafe mode' which allows these things, but there's no easy way to do that programatically.<br></div><div><br></div><div>Best wishes,<br></div><div>Thomas<br></div><div><br></div><div>On Sat, 18 May 2024, at 09:41, Dave Amies wrote:<br></div><blockquote type="cite" id="qt" style=""><div dir="ltr"><div dir="ltr" class="qt-gmail_attr">Hi All,<br></div><div dir="ltr"><div><br></div><div>I'm new here, so perhaps it's best to explain what I'm aiming to achieve and you can tell me if I'm heading in the right direction?<br></div><div><br></div><div>I want to create a add in library for an open source test automation tool that will allow the automation of linux desktop apps, there is already a library for windows desktop apps but for linux and mac the only options are image based test which are unreliable and clumsy, so my goal is to try and fix this for linux.<br></div><div><br></div><div>I have written libraries for this test automation tool before, It uses python for these libraries and that part is quite easy.<br></div><div><br></div><div>So far my searches for how to do various desktop actions using python all led me to dbus, but then I also see comments that the examples no longer work in newer versions of gnome due to security reasons.<br></div><div><br></div><div><div>I've installed d-feet on my machine and had a bit of a poke around but honestly I'm a bit lost and don't really know where to start and what the best practices are<br></div></div><div>So I guess I'm looking for a beginner's guide to dbus for automating the desktop, gnome & kde is probably a minimum I'll need, but if the code can be generic and support mre DE's that would be great.<br></div><div><br></div><div>My first steps I'd like to achieve are:<br></div><div>- get a list of open windows<br></div><div>- get the active/foreground window (I know it's not always the same thing)<br></div><div>- bring a window to the foreground & make it active<br></div><div>- get a window position & size<br></div><div>- move a window<br></div><div>- resize a window<br></div><div><br></div><div>Any pointers would be appreciated, I don't expect code examples, just point me in the right direction in the documentation.<br></div><div><br></div><div><div>Thanks,<br></div><div><br></div><div>Dave.<br></div></div><div><br></div></div></div></blockquote><div><br></div></body></html>