Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Howto to show program window in specific desktop using python

I am writing python app and need to run another program in specific (not the current one) desktop in openbox (I have 4 desktops). There is freedesktop _NET_CURRENT_DESKTOP param, but I don't know how to change it under python and gi.repository (Wnck, Gdk?). Or maybe use Xlib? I can't find what is best method to do it...

like image 687
marcinpz Avatar asked Aug 15 '26 08:08

marcinpz


1 Answers

With PyGTK, you would create a gio.AppInfo instance representing the application you want to launch, then provide a gtk.gdk.AppLaunchContext to its launch() method.

When you create the launch context, you would call its set_desktop() method to specify the index of the desktop the launched application will run on.

like image 69
Frédéric Hamidi Avatar answered Aug 17 '26 22:08

Frédéric Hamidi