diff options
Diffstat (limited to 'chrome-shutdown-hook.py')
-rw-r--r-- | chrome-shutdown-hook.py | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/chrome-shutdown-hook.py b/chrome-shutdown-hook.py index 87fd099c5c57..23f538637786 100644 --- a/chrome-shutdown-hook.py +++ b/chrome-shutdown-hook.py @@ -14,20 +14,24 @@ import gnome.ui import gtk def chrome_clean_shutdown(*args): - subprocess.call("/usr/bin/pkill -15 -P 1 chrome", shell=True) + subprocess.call('/usr/bin/pkill -15 -P 1 chrome', shell=True) return True + def chromium_clean_shutdown(*args): - subprocess.call("/usr/bin/pkill -15 -P 1 chromium", shell=True) + subprocess.call('/usr/bin/pkill -15 -P 1 chromium', shell=True) return True + def main(): - prog = gnome.init("chrome_clean_shutdown", "1.2.2") + prog = gnome.init('chrome_clean_shutdown', '1.2.3') client = gnome.ui.master_client() - if (subprocess.call("hash chromium", shell=True) == 0): - client.connect("save-yourself", chromium_clean_shutdown) - if (subprocess.call("hash google-chrome-stable", shell=True) == 0): - client.connect("save-yourself", chrome_clean_shutdown) + if subprocess.call('hash chromium', shell=True) == 0: + client.connect('save-yourself', chromium_clean_shutdown) + if subprocess.call('hash google-chrome-stable', shell=True) == 0: + client.connect('save-yourself', chrome_clean_shutdown) + + main() gtk.main() |