1
0
forked from ports/contrib

tint2: fixed battery power_now support (Thanks to Oleksii Tkachuk)

This commit is contained in:
Jose V Beneyto 2013-08-07 23:55:02 +02:00
parent 5bea5cab90
commit 56fe14c1df
3 changed files with 25 additions and 2 deletions

View File

@ -1 +1,2 @@
6cfcad028f1bd2f69812167f5395f890 add-power-now-support.patch
6fc5731e7425125fa84a2add5cef4bff tint2-0.11.tar.bz2

View File

@ -6,12 +6,15 @@
name=tint2
version=0.11
release=1
source=(http://$name.googlecode.com/files/$name-$version.tar.bz2)
release=2
source=(http://$name.googlecode.com/files/$name-$version.tar.bz2 \
add-power-now-support.patch)
build() {
cd $name-$version
patch -p0 -i $SRC/add-power-now-support.patch
cmake \
-DCMAKE_INSTALL_PREFIX=/usr \
-DENABLE_BATTERY=ON \

View File

@ -0,0 +1,19 @@
diff -rup ../tint2-0.11.orig/src/battery/battery.c ./src/battery/battery.c
--- ../tint2-0.11.orig/src/battery/battery.c 2010-12-02 23:56:11.313403140 +0100
+++ ./src/battery/battery.c 2010-12-02 23:57:22.266956142 +0100
@@ -184,8 +184,14 @@ void init_battery()
}
g_free(path2);
}
- if (path_energy_now && path_energy_full) {
+
+ path_current_now = g_build_filename(battery_dir, "power_now", NULL);
+ if (!g_file_test (path_current_now, G_FILE_TEST_EXISTS)) {
+ g_free(path_current_now);
path_current_now = g_build_filename(battery_dir, "current_now", NULL);
+ }
+
+ if (path_energy_now && path_energy_full) {
path_status = g_build_filename(battery_dir, "status", NULL);
// check file