Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import subprocess
- import wnck
- import gtk
- import time
- screen = wnck.screen_get_default()
- while gtk.events_pending():
- gtk.main_iteration()
- window_list = screen.get_windows_stacked()
- last_active = None
- for window in window_list:
- if window.get_application().get_name() == "Google Chrome":
- last_active = window
- if last_active:
- timestamp = int(time.time())
- last_active.activate(timestamp)
- else:
- subprocess.Popen("google-chrome")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement