[Pkg-wmaker-commits] [wmbattery] 126/241: use upower by default

Doug Torrance dtorrance-guest at moszumanska.debian.org
Mon Aug 24 23:37:46 UTC 2015


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to branch master
in repository wmbattery.

commit d4297896b7870b52d10e6128ee3b6046ac234def
Author: Joey Hess <joey at kitenet.net>
Date:   Thu Dec 5 13:45:50 2013 -0400

    use upower by default
---
 README           |  1 +
 debian/changelog |  4 +++-
 debian/control   |  3 +--
 wmbattery.1x     |  5 ++---
 wmbattery.c      | 14 ++++++++------
 5 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/README b/README
index 2d145dc..60c54bc 100644
--- a/README
+++ b/README
@@ -20,6 +20,7 @@ some improvements in wmbattery:
   - ACPI support, including multiple battery support and battery charging
     completion countdown timer.
   - HAL support.
+  - upower support.
   - Can make its own estimatess of time remaining or time until full
     charge, even if APM does not.
 
diff --git a/debian/changelog b/debian/changelog
index 8da5043..26d5f32 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,7 +4,9 @@ wmbattery (2.42) UNRELEASED; urgency=low
     interface to use /sys/class/power_supply.
     Note that this needs acpica_version 20120111, as provided by a recent
     linux kernel version. Closes: #613166
-    (Patch developed by Mageia.)
+    (Patch developed by Andrew Shadura.)
+  * Also added support for upower, which is used by default.
+    (Patch developed by Andrew Shadura.)
 
  -- Joey Hess <joeyh at debian.org>  Tue, 30 Apr 2013 21:24:41 -0400
 
diff --git a/debian/control b/debian/control
index 2aa462b..daaaad5 100644
--- a/debian/control
+++ b/debian/control
@@ -20,6 +20,5 @@ Description: display laptop battery info, dockable in WindowMaker
  There's nothing in the program that makes it require WindowMaker, except
  maybe the look. It can be docked in WindowMaker or AfterStep's dock.
  .
- wmbattery can use HAL, APM, ACPI, or even the SPIC that is in some Sony
- laptops. It supports multi-battery machines, and can estimate how long
+ wmbattery supports multi-battery machines, and can estimate how long
  it will take the battery to finish charging or discharging.
diff --git a/wmbattery.1x b/wmbattery.1x
index f879afc..79bcf77 100644
--- a/wmbattery.1x
+++ b/wmbattery.1x
@@ -11,9 +11,8 @@ is a battery monitor.  It is used to visually display the system's battery
 status.
 .PP
 .B wmbattery
-can get battery information using HAL, APM, ACPI, or
-the SPIC controller in some Sony laptops. You need to build your kernel with
-support for at least one of these for the program to work.
+can get battery information using upower, HAL, APM, ACPI, or
+the SPIC controller in some Sony laptops.
 .B wmbattery
 is dockable using WindowMaker and AfterStep window managers; under
 other window managers
diff --git a/wmbattery.c b/wmbattery.c
index 07a5daf..bdd4b92 100644
--- a/wmbattery.c
+++ b/wmbattery.c
@@ -524,7 +524,15 @@ void alarmhandler(int sig) {
 	int old_status;
 
 	old_status = cur_info.battery_status;
+#ifdef UPOWER
+	if (use_upower) {
+		if (upower_read(1, &cur_info) != 0)
+			error("Cannot read upower information.");
+	}
+	else if (use_acpi) {
+#else
 	if (use_acpi) {
+#endif
 		if (acpi_read(battnum, &cur_info) != 0)
 			error("Cannot read ACPI information.");
 	}
@@ -534,12 +542,6 @@ void alarmhandler(int sig) {
 			error("Cannot read HAL information.");
 	}
 #endif
-#ifdef UPOWER
-	else if (use_upower) {
-		if (upower_read(1, &cur_info) != 0)
-			error("Cannot read UPOWER information.");
-	}
-#endif
 	else if (! use_sonypi) {
 		if (apm_read(&cur_info) != 0)
 			error("Cannot read APM information.");

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmbattery.git



More information about the Pkg-wmaker-commits mailing list