summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO22
-rw-r--r--PKGBUILD32
-rw-r--r--batti.install14
-rw-r--r--upower-0.99.patch34
4 files changed, 102 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..ad9fcc6c103f
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,22 @@
+pkgbase = batti
+ pkgdesc = Simple battery monitor for the system tray
+ pkgver = 0.3.8
+ pkgrel = 5
+ url = http://code.google.com/p/batti-gtk/
+ install = batti.install
+ arch = any
+ license = GPL
+ depends = dbus-python
+ depends = pygtk
+ depends = gtk2
+ depends = upower
+ depends = hicolor-icon-theme
+ optdepends = notification-daemon: for power status notifications
+ optdepends = xfce4-notifyd: alternative to notification-daemon
+ source = http://batti-gtk.googlecode.com/files/batti-0.3.8.tar.gz
+ source = upower-0.99.patch
+ md5sums = 4b239ead1643c95a6d89c380bc167781
+ md5sums = 237c98190cfd5725c9f5483c770a7763
+
+pkgname = batti
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..ed2d196e60ad
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,32 @@
+# Maintainer: Alexander Rødseth <rodseth@gmail.com>
+# Contributor: Fetid Frog <fetidfrog at gmail dot com>
+# Contributor: Balló György <ballogyor+arch at gmail dot com>
+
+pkgname=batti
+pkgver=0.3.8
+pkgrel=5
+pkgdesc='Simple battery monitor for the system tray'
+arch=('any')
+url='http://code.google.com/p/batti-gtk/'
+license=('GPL')
+depends=('dbus-python' 'pygtk' 'gtk2' 'upower' 'hicolor-icon-theme')
+optdepends=('notification-daemon: for power status notifications' 'xfce4-notifyd: alternative to notification-daemon')
+install="$pkgname.install"
+source=("http://batti-gtk.googlecode.com/files/$pkgname-$pkgver.tar.gz"
+ 'upower-0.99.patch')
+md5sums=('4b239ead1643c95a6d89c380bc167781'
+ '237c98190cfd5725c9f5483c770a7763')
+
+prepare() {
+ cd "$pkgname-$pkgver"
+
+ patch -p1 -i "$srcdir/upower-0.99.patch"
+}
+
+package() {
+ cd "$pkgname-$pkgver"
+
+ python2 setup.py install --root="$pkgdir" --optimize=1
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/batti.install b/batti.install
new file mode 100644
index 000000000000..c7ee9e3d1d2a
--- /dev/null
+++ b/batti.install
@@ -0,0 +1,14 @@
+post_upgrade() {
+ gtk-update-icon-cache -q -f -t /usr/share/icons/hicolor
+}
+
+post_install() {
+ echo "You may need to install a GTK icon theme to display battery status."
+ post_upgrade
+}
+
+post_remove() {
+ post_upgrade
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/upower-0.99.patch b/upower-0.99.patch
new file mode 100644
index 000000000000..6f313a594c94
--- /dev/null
+++ b/upower-0.99.patch
@@ -0,0 +1,34 @@
+diff -Naur batti-0.3.8.orig/src/PowerBackend.py batti-0.3.8/src/PowerBackend.py
+--- batti-0.3.8.orig/src/PowerBackend.py 2014-04-15 19:30:34.123260000 +0200
++++ batti-0.3.8/src/PowerBackend.py 2014-04-15 19:32:11.859168509 +0200
+@@ -180,17 +180,6 @@
+
+ properties = dbus.Interface(iface, 'org.freedesktop.DBus.Properties')
+
+- if properties.Get(self.dbus_interface, 'CanSuspend'):
+- self.__can_suspend = True
+- else:
+- self.__can_suspend = False
+-
+- if properties.Get(self.dbus_interface, 'CanHibernate'):
+- self.__can_hibernate = True
+- else:
+- self.__can_hibernate = False
+-
+-
+ def __get_interface(self):
+ dkit_obj = self.__bus.get_object(self.dbus_service, self.dbus_object)
+ return dbus.Interface(dkit_obj, self.dbus_interface)
+@@ -201,12 +190,6 @@
+ self.__mc_action(widget, event, data)
+
+
+- def can_suspend(self):
+- return self.__can_suspend and self.__get_interface().SuspendAllowed()
+-
+- def can_hibernate(self):
+- return self.__can_hibernate and self.__get_interface().HibernateAllowed()
+-
+ def suspend(self):
+ self.__get_interface().Suspend()
+