Quick tip: you can do a Show Desktop from a script (from Python, in this case), with:
python -c "import gtk,wnck,gobject; s=wnck.screen_get_default(); s.toggle_showing_desktop(True); gobject.idle_add(gtk.main_quit); gtk.main()"
Quick tip: you can do a Show Desktop from a script (from Python, in this case), with:
python -c "import gtk,wnck,gobject; s=wnck.screen_get_default(); s.toggle_showing_desktop(True); gobject.idle_add(gtk.main_quit); gtk.main()"
Interesting; I’d not seen wnck - does it allow you to show windows fullscreen without menus, etc?
Posted by mrben on June 14th, 2006.
mrben: wnck is an interface to the window manager, essentially. It’s what the pager uses to know where windows are and so on. I’m not sure if it lets you alter an existing window; devilspie does that, but I don’t know if it uses libwnck.
Posted by sil on June 14th, 2006.
mrben, sil: It seems that wnck can do that (or at least its API has the corresponding functions ;-)). It looks equivalent to devilspie, or slighly more detailed (e.g. for viewport).
It works ONLY if you have called gtk.main(), e.g. :
def run():
print wnck.screen_get_default().get_windows()
# do your job here
gtk.main_quit()
gobject.idle_add(run)
gtk.main()
Posted by jiba on October 18th, 2006.
Well, I the code provided by jiba. But, I got none windows:
leon@localhost ~/tmp_python $ python wm.max.py
[]
Why ? But, the “Show Desktop” code works.
Posted by Leon on January 28th, 2007.
Hi, where i can find tha API for the libwnck python module ??
Posted by Manuel Mazzuola on March 8th, 2007.
Manuel,
Trying to build sugar I presume? I’m looking for it as well.
Posted by bj on March 9th, 2007.
Sugar ? what is ?
Posted by Manuel on March 9th, 2007.
You need to run force_update() on the screen before pulling anything from it. If you run that before get_windows() it all works OK! :)
Posted by mibus on June 6th, 2007.