diff options
author | Clastres Térence | 2016-08-09 23:46:13 +0200 |
---|---|---|
committer | Clastres Térence | 2016-08-09 23:46:13 +0200 |
commit | 36c13b6f727c811b8a4b33ee618a13f68123d943 (patch) | |
tree | c41dc3a230205fe52b0b5e14abe248f4876ef6cd | |
parent | 6bd964ddc30202aece25111941ccc37f7c5f5a16 (diff) | |
download | aur-36c13b6f727c811b8a4b33ee618a13f68123d943.tar.gz |
Add chromium support
-rw-r--r-- | .SRCINFO | 6 | ||||
-rw-r--r-- | PKGBUILD | 6 | ||||
-rw-r--r-- | chrome-shutdown-hook.py | 15 |
3 files changed, 18 insertions, 9 deletions
@@ -1,6 +1,6 @@ pkgbase = chrome-shutdown-hook - pkgdesc = Gently shutdown Chrome on logout from Gnome Shell. - pkgver = 1.1 + pkgdesc = Gently shutdown Chrome/Chromium on logout from Gnome Shell. + pkgver = 1.2 pkgrel = 1 url = https://www.google.com/chrome/index.html arch = any @@ -12,7 +12,7 @@ pkgbase = chrome-shutdown-hook source = chrome-shutdown-hook.desktop source = chrome-shutdown-hook.py md5sums = 45087b31730315e1ed785205739d9943 - md5sums = b5025192b032fb0e3dfa92c9684a3c8c + md5sums = 488167eff465bb620bdece25582aba4b pkgname = chrome-shutdown-hook @@ -1,9 +1,9 @@ # Maintainer: Michael Goehler <somebody dot here at gmx dot de> pkgname=chrome-shutdown-hook -pkgver=1.1 +pkgver=1.2 pkgrel=1 -pkgdesc="Gently shutdown Chrome on logout from Gnome Shell." +pkgdesc="Gently shutdown Chrome/Chromium on logout from Gnome Shell." arch=('any') url="https://www.google.com/chrome/index.html" license=('GPL') @@ -13,7 +13,7 @@ license=('GPL') source=("chrome-shutdown-hook.desktop" "chrome-shutdown-hook.py") md5sums=('45087b31730315e1ed785205739d9943' - 'b5025192b032fb0e3dfa92c9684a3c8c') + '488167eff465bb620bdece25582aba4b') package() { cd "${srcdir}" 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() |