diff options
author | Michael Göhler | 2015-06-08 11:12:47 +0200 |
---|---|---|
committer | Michael Göhler | 2015-06-08 11:24:11 +0200 |
commit | e2efc1db1d78c4e7fb151548cf34f0305799f0ca (patch) | |
tree | 2b76893ba8fa5bb486b819aec88da9a5659a881c | |
download | aur-e2efc1db1d78c4e7fb151548cf34f0305799f0ca.tar.gz |
initial submission to aur4
-rw-r--r-- | .SRCINFO | 18 | ||||
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | PKGBUILD | 24 | ||||
-rw-r--r-- | chrome-shutdown-hook.desktop | 8 | ||||
-rw-r--r-- | chrome-shutdown-hook.py | 32 |
5 files changed, 85 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..87d333006fde --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,18 @@ +pkgbase = chrome-shutdown-hook + pkgdesc = Gently shutdown Chrome on logout from Gnome Shell. + pkgver = 1.0 + pkgrel = 1 + url = https://www.google.com/chrome/index.html + arch = any + license = GPL + depends = procps-ng + depends = python2 + depends = gnome-python + optdepends = gnome-tweak-tool: to enable this hook as a Gnome Startup Application + source = chrome-shutdown-hook.desktop + source = chrome-shutdown-hook.py + md5sums = 45087b31730315e1ed785205739d9943 + md5sums = a493eb5fd62e90dcd3935f78d977087c + +pkgname = chrome-shutdown-hook + diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..43d261a5d822 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +pkg +src +*.pkg.tar.xz diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..9f4bdc4a90a8 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,24 @@ +# Maintainer: Michael Goehler <somebody dot here at gmx dot de> + +pkgname=chrome-shutdown-hook +pkgver=1.0 +pkgrel=1 +pkgdesc="Gently shutdown Chrome on logout from Gnome Shell." +arch=('any') +url="https://www.google.com/chrome/index.html" +license=('GPL') +depends=('procps-ng' 'python2' 'gnome-python') +optdepends=('gnome-tweak-tool: to enable this hook as a Gnome Startup Application') +license=('GPL') +source=("chrome-shutdown-hook.desktop" + "chrome-shutdown-hook.py") +md5sums=('45087b31730315e1ed785205739d9943' + 'a493eb5fd62e90dcd3935f78d977087c') + +package() { + cd "${srcdir}" + install -Dm755 "chrome-shutdown-hook.py" "${pkgdir}/usr/bin/chrome-shutdown-hook" + install -Dm644 "chrome-shutdown-hook.desktop" "${pkgdir}/usr/share/applications/chrome-shutdown-hook.desktop" +} + +# vim: ts=2 sw=2 et: diff --git a/chrome-shutdown-hook.desktop b/chrome-shutdown-hook.desktop new file mode 100644 index 000000000000..fdb21b43bb69 --- /dev/null +++ b/chrome-shutdown-hook.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Name=Chrome Shotdown Hook +Comment=Gently shutdown Chrome on logout from Gnome Shell +Exec=/usr/bin/chrome-shutdown-hook +Icon=view-restore-symbolic +Terminal=false +Type=Application +Categories=GNOME;GTK; diff --git a/chrome-shutdown-hook.py b/chrome-shutdown-hook.py new file mode 100644 index 000000000000..58cf6bc7be97 --- /dev/null +++ b/chrome-shutdown-hook.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python2 + +# Author: Michael Goehler +# Description: Gently shutdown Chrome on logout from Gnome Shell. +# +# Based on a script by Seamus Phelan +# http://unix.stackexchange.com/questions/49333/ + +import sys +import subprocess +import datetime +import gnome +import gnome.ui +import gtk + +class Namespace: pass +ns = Namespace() +ns.dialog = None + +def main(): + prog = gnome.init("chrome_clean_shutdown", "1.0", gnome.libgnome_module_info_get(), sys.argv, []) + client = gnome.ui.master_client() + client.connect("save-yourself", chrome_clean_shutdown) + +def chrome_clean_shutdown(*args): + subprocess.call("/usr/bin/pkill -15 -P 1 chrome", shell=True) + return True + +main() +gtk.main() + +# vim: set ts=4 sw=4 et: |