summaryrefslogtreecommitdiff
path: root/extra/xfce4-battery-plugin/show-time-when-on-battery.patch
blob: d5ed364609bf9cddbb9013cad81b96cd237808d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
From f4a68f05e838291d1ddcb60f7c719873bfd57d27 Mon Sep 17 00:00:00 2001
From: flo <florian.a.jung@web.de>
Date: Fri, 18 Feb 2011 17:21:12 +0000
Subject: Show time when on battery power (bug #3736).

---
diff --git a/panel-plugin/libacpi.c b/panel-plugin/libacpi.c
index 87339b7..838a760 100644
--- a/panel-plugin/libacpi.c
+++ b/panel-plugin/libacpi.c
@@ -787,7 +787,7 @@ int read_acpi_state_sysfs(int battery)
 			acpistate->rcapacity = read_sysfs_int(buf);
 			acpistate->percentage = (((float) acpistate->rcapacity)/acpiinfo->last_full_capacity) * 100;
 		}
-		if (strcmp(name,"current_now") == 0)
+		if ((strcmp(name,"current_now") == 0) || (strcmp(name,"power_now") == 0))
 		{
 			sprintf(buf,"%s/%s",batteries[battery], name);
 			acpistate->prate = read_sysfs_int(buf);
--
cgit v0.9.0.2