How to get list opened windows in PyGTK or GTK or other programming language? in Ubuntu?
edit:
i want get list paths opened directories on
For whatever reason, I can't post a comment, but I'd like to add this as an addendum to Sandy's answer.
Here's a chunk of code that lists the current windows on the console:
import pygtk
pygtk.require('2.0')
import gtk, wnck
if __name__ == "__main__":
default = wnck.screen_get_default()
while gtk.events_pending():
gtk.main_iteration(False)
window_list = default.get_windows()
if len(window_list) == 0:
print "No Windows Found"
for win in window_list:
if win.is_active():
print '***' + win.get_name()
else:
print win.get_name()
Thanks Sandy!