aboutsummaryrefslogtreecommitdiffstats
path: root/community/xfce4-battery-plugin/00-fix-percentage-detection.patch
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 /community/xfce4-battery-plugin/00-fix-percentage-detection.patch
parent3bd4ffb8790ff2dd9eedead0a32bb06c8447b2d4 (diff)
downloadaports-7e2632891a23b5b2b951fdd13f4ec7a6a4b0fd3d.tar.gz
aports-7e2632891a23b5b2b951fdd13f4ec7a6a4b0fd3d.tar.bz2
aports-7e2632891a23b5b2b951fdd13f4ec7a6a4b0fd3d.tar.xz
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>
Diffstat (limited to 'community/xfce4-battery-plugin/00-fix-percentage-detection.patch')
-rw-r--r--community/xfce4-battery-plugin/00-fix-percentage-detection.patch9
1 files changed, 7 insertions, 2 deletions
diff --git a/community/xfce4-battery-plugin/00-fix-percentage-detection.patch b/community/xfce4-battery-plugin/00-fix-percentage-detection.patch
index c7deddd366..82d28c52d6 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);