mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-08-06 00:48:18 -07:00
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:
45
app-laptop/batti/batti-0.3.8-r4.ebuild
Normal file
45
app-laptop/batti/batti-0.3.8-r4.ebuild
Normal 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
|
||||
}
|
||||
32
app-laptop/batti/files/batti-0.3.8-upower-capital.patch
Normal file
32
app-laptop/batti/files/batti-0.3.8-upower-capital.patch
Normal 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)
|
||||
Reference in New Issue
Block a user