app-laptop/batti: Support current upower version (#600914 by idl0r), hicolor-icon-theme provides the enough icons for this.

Package-Manager: Portage-2.3.6, Repoman-2.3.2
This commit is contained in:
Pacho Ramos
2017-06-18 11:17:04 +02:00
parent 70d63adcb2
commit fca6415a98
2 changed files with 77 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
PYTHON_COMPAT=( python2_7 )
inherit distutils-r1 gnome2-utils
DESCRIPTION="A upower based battery monitor for the system tray, similar to batterymon"
HOMEPAGE="https://code.google.com/p/batti-gtk/"
SRC_URI="https://batti-gtk.googlecode.com/files/${P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="libnotify"
RDEPEND="
dev-python/pygtk:2[${PYTHON_USEDEP}]
dev-python/dbus-python[${PYTHON_USEDEP}]
|| ( sys-power/upower sys-power/upower-pm-utils )
x11-themes/hicolor-icon-theme
libnotify? ( x11-libs/libnotify )
"
DEPEND=""
src_prepare() {
default
if has_version ">=sys-power/upower-0.99"; then
eapply "${FILESDIR}/${P}-upower-0.99.patch"
eapply "${FILESDIR}/${P}-upower-capital.patch"
fi
}
pkg_preinst() {
gnome2_icon_savelist
}
pkg_postinst() {
gnome2_icon_cache_update
}
pkg_postrm() {
gnome2_icon_cache_update
}

View File

@@ -0,0 +1,32 @@
From 1e0fe57a93ed3996bad295e20eeda81f6af483af Mon Sep 17 00:00:00 2001
From: Christian Ruppert <idl0r@gentoo.org>
Date: Wed, 20 Jul 2016 20:14:32 +0200
Subject: [PATCH] The type property (in recent UPower at least) needs to have a
capital T - "Type"
---
src/PowerBackend.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/PowerBackend.py b/src/PowerBackend.py
index e020b98..56bcb61 100644
--- a/src/PowerBackend.py
+++ b/src/PowerBackend.py
@@ -165,7 +165,7 @@ def __init__(self):
self.__batteries = {}
for dev in devices:
(prop_iface, dev_iface) = self.__get_battery(dev)
- type = prop_iface.Get(self.device_interface, 'type')
+ type = prop_iface.Get(self.device_interface, 'Type')
if type == self.bat_type:
power_bat = UPowerBattery(prop_iface, dev_iface)
self.__batteries[dev] = power_bat
@@ -228,7 +228,7 @@ def set_right_popup_menu_action(self, action):
def __device_added(self, udi):
(prop_iface, dev_iface) = self.__get_battery(udi)
try:
- type = prop_iface.Get(self.device_interface, 'type')
+ type = prop_iface.Get(self.device_interface, 'Type')
if type == self.bat_type:
power_bat = UPowerBattery(prop_iface, dev_iface)
power_bat.set_left_popup_menu_action(self.__mc_action)