diff options
author | Clastres Térence | 2016-08-31 18:29:13 +0200 |
---|---|---|
committer | Clastres Térence | 2016-08-31 18:29:13 +0200 |
commit | 28dad7c7481c234bfa68b9490e182cc7988d63da (patch) | |
tree | 05b57ba5d68ff15ccca9b628cb970c22bf82a1ed | |
parent | 4f00935918bddf83523064463f1391343f9b95a4 (diff) | |
download | aur-28dad7c7481c234bfa68b9490e182cc7988d63da.tar.gz |
Fix case where no PPID is found
-rw-r--r-- | .SRCINFO | 4 | ||||
-rw-r--r-- | PKGBUILD | 4 | ||||
-rw-r--r-- | chrome-shutdown-hook.py | 7 |
3 files changed, 8 insertions, 7 deletions
@@ -1,6 +1,6 @@ pkgbase = chrome-shutdown-hook pkgdesc = Gently shutdown Chrome/Chromium on logout from Gnome Shell. - pkgver = 1.2.3 + pkgver = 1.3.1 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 = e9e039b29bf1c7a027ef6b3a2946b6a9 - md5sums = 34a5272e929a1f735b400f799cf1a7af + md5sums = 58b7aaee6f7ccdef4508f38f72b96bb1 pkgname = chrome-shutdown-hook @@ -1,7 +1,7 @@ # Maintainer: Michael Goehler <somebody dot here at gmx dot de> pkgname=chrome-shutdown-hook -pkgver=1.2.3 +pkgver=1.3.1 pkgrel=1 pkgdesc="Gently shutdown Chrome/Chromium on logout from Gnome Shell." arch=('any') @@ -13,7 +13,7 @@ license=('GPL') source=("chrome-shutdown-hook.desktop" "chrome-shutdown-hook.py") md5sums=('e9e039b29bf1c7a027ef6b3a2946b6a9' - '34a5272e929a1f735b400f799cf1a7af') + '58b7aaee6f7ccdef4508f38f72b96bb1') package() { cd "${srcdir}" diff --git a/chrome-shutdown-hook.py b/chrome-shutdown-hook.py index 23f538637786..29c73b213f72 100644 --- a/chrome-shutdown-hook.py +++ b/chrome-shutdown-hook.py @@ -14,15 +14,16 @@ import gnome.ui import gtk def chrome_clean_shutdown(*args): - subprocess.call('/usr/bin/pkill -15 -P 1 chrome', shell=True) + if subprocess.call('/usr/bin/pkill -15 -P 1 chrome', shell=True) == 1: + subprocess.call('/usr/bin/pkill -15 -o chrome', shell=True) // if no parent, kill the oldest process return True def chromium_clean_shutdown(*args): - subprocess.call('/usr/bin/pkill -15 -P 1 chromium', shell=True) + if subprocess.call('/usr/bin/pkill -15 -P 1 chromium', shell=True) == 1: + subprocess.call('/usr/bin/pkill -15 -o chromium', shell=True) return True - def main(): prog = gnome.init('chrome_clean_shutdown', '1.2.3') client = gnome.ui.master_client() |