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
Parsing command line output is usually not the best way, you are dependent on that programs output not changing, which could vary from version or platfrom. Here is how to do it using Xlib:
import Xlib.display
screen = Xlib.display.Display().screen()
root_win = screen.root
window_names = []
for window in root_win.query_tree()._data['children']:
window_name = window.get_wm_name()
window_names.append(window_name)
print window_names
Note that this list will contain windows that you wouldn't normally classify as 'windows', but that doesn't matter for what you are trying to do.