summarylogtreecommitdiffstats
path: root/chrome-shutdown-hook.py
diff options
context:
space:
mode:
authorClastres Térence2016-08-09 23:46:13 +0200
committerClastres Térence2016-08-09 23:46:13 +0200
commit36c13b6f727c811b8a4b33ee618a13f68123d943 (patch)
treec41dc3a230205fe52b0b5e14abe248f4876ef6cd /chrome-shutdown-hook.py
parent6bd964ddc30202aece25111941ccc37f7c5f5a16 (diff)
downloadaur-36c13b6f727c811b8a4b33ee618a13f68123d943.tar.gz
Add chromium support
Diffstat (limited to 'chrome-shutdown-hook.py')
-rw-r--r--chrome-shutdown-hook.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/chrome-shutdown-hook.py b/chrome-shutdown-hook.py
index 543754054afd..d8eaa59e3364 100644
--- a/chrome-shutdown-hook.py
+++ b/chrome-shutdown-hook.py
@@ -14,13 +14,22 @@ 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 chrome", shell=True)
+ return True
+
+def chromium_clean_shutdown(*args):
+ subprocess.call("/usr/bin/pkill -15 chromium", shell=True)
return True
def main():
- prog = gnome.init("chrome_clean_shutdown", "1.1")
+ prog = gnome.init("chrome_clean_shutdown", "1.2")
client = gnome.ui.master_client()
- client.connect("save-yourself", chrome_clean_shutdown)
+
+ if subprocess.call("hash google-chrome-stable", shell=True):
+ client.connect("save-yourself", chrome_clean_shutdown)
+
+ if subprocess.call("hash chromium", shell=True):
+ client.connect("save-yourself", chromium_clean_shutdown)
main()
gtk.main()