aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanct12 <danct12@disroot.org>2020-03-02 02:42:52 +0700
committerRasmus Thomsen <oss@cogitri.dev>2020-03-01 23:02:43 +0100
commit7e2632891a23b5b2b951fdd13f4ec7a6a4b0fd3d (patch)
tree4ef1a0482f99b4aff939df3c337c0fe1de2a6622
parent3bd4ffb8790ff2dd9eedead0a32bb06c8447b2d4 (diff)
community/xfce4-battery-plugin: fix battery detection on (some) devices
On some devices, charge_counter is used instead of charge_now Signed-off-by: Danct12 <danct12@disroot.org>
-rw-r--r--community/xfce4-battery-plugin/00-fix-percentage-detection.patch9
-rw-r--r--community/xfce4-battery-plugin/APKBUILD4
2 files changed, 9 insertions, 4 deletions
diff --git a/community/xfce4-battery-plugin/00-fix-percentage-detection.patch b/community/xfce4-battery-plugin/00-fix-percentage-detection.patch
index c7deddd366d..82d28c52d67 100644
--- a/community/xfce4-battery-plugin/00-fix-percentage-detection.patch
+++ b/community/xfce4-battery-plugin/00-fix-percentage-detection.patch
@@ -31,7 +31,7 @@ index b730274..aa0d993 100644
if (last_acline)
time_remaining = ((float)(lcapacity-ccapacity)/(float)(rate))*60;
diff --git a/panel-plugin/libacpi.c b/panel-plugin/libacpi.c
-index 0755585..2737fe3 100644
+index 0755585..671d624 100644
--- a/panel-plugin/libacpi.c
+++ b/panel-plugin/libacpi.c
@@ -518,6 +518,7 @@ read_acpi_state_sysfs(int battery)
@@ -42,7 +42,12 @@ index 0755585..2737fe3 100644
sysfs = opendir(batteries[battery]);
if (sysfs == 0)
-@@ -559,7 +560,11 @@ read_acpi_state_sysfs(int battery)
+@@ -555,11 +556,15 @@ read_acpi_state_sysfs(int battery)
+ }
+
+ /* on my system this is called charge_now */
+- if ((strcmp(name,"energy_now") == 0) || (strcmp(name,"charge_now") == 0))
++ if ((strcmp(name,"energy_now") == 0) || (strcmp(name,"charge_now") == 0) || (strcmp(name,"charge_counter") == 0))
{
sprintf(buf,"%s/%s",batteries[battery], name);
acpistate->rcapacity = read_sysfs_int(buf);
diff --git a/community/xfce4-battery-plugin/APKBUILD b/community/xfce4-battery-plugin/APKBUILD
index ede7ba854e8..9d2b40af994 100644
--- a/community/xfce4-battery-plugin/APKBUILD
+++ b/community/xfce4-battery-plugin/APKBUILD
@@ -1,7 +1,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=xfce4-battery-plugin
pkgver=1.1.3
-pkgrel=1
+pkgrel=2
pkgdesc="A battery monitor plugin for the Xfce panel"
url="http://goodies.xfce.org/projects/panel-plugins/xfce4-battery-plugin"
arch="all"
@@ -26,4 +26,4 @@ package() {
}
sha512sums="a591fb37855efbd54d18ae97e320fa4521da611c8ea107813bfd66fa570e8c84576fcf779c7b676ee9918709912de728b0fed490e64d3d2ad403baf719db4520 xfce4-battery-plugin-1.1.3.tar.bz2
-b40d122d5b80ac548f739dcda3e9a049b9183b5aa8d0f2e0e5b7f4bb91024bdc0722ecb6492dc0296c6b0a50598a871a254181f33ce3cea2f4bdd7a64b32343e 00-fix-percentage-detection.patch"
+d373c4ec7b0efbbf032bc553e04fa9b7784e3a41df83f285ca061696424f2c739a4b1a1a1c2f9f6a7b22ff8986ee4171eb009687297658ada027aa1c85536f6c 00-fix-percentage-detection.patch"