summarylogtreecommitdiffstats
path: root/disable-apm.patch
blob: 26d99cb84e0af2c68c43dda8c61c1035eab63014 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
diff -purN wmbattery.orig/apm.h wmbattery/apm.h
--- wmbattery.orig/apm.h	2013-04-11 10:08:58.000000000 -0600
+++ wmbattery/apm.h	2013-04-11 10:14:23.000000000 -0600
@@ -1,4 +1,17 @@
-#include <apm.h>
+typedef struct apm_info
+{
+	const char driver_version[10];
+	int apm_version_major;
+	int apm_version_minor;
+	int apm_flags;
+	int ac_line_status;
+	int battery_status;
+	int battery_flags;
+	int battery_percentage;
+	int battery_time;
+	int using_minutes;
+}
+apm_info;
 
 /* Symbolic constants for apm may be in system apm.h, or may not. */
 #ifndef AC_LINE_STATUS_ON
diff -purN wmbattery.orig/wmbattery.c wmbattery/wmbattery.c
--- wmbattery.orig/wmbattery.c	2013-04-11 10:08:58.000000000 -0600
+++ wmbattery/wmbattery.c	2013-04-11 10:15:29.000000000 -0600
@@ -528,10 +528,6 @@ void alarmhandler(int sig) {
 			error("Cannot read HAL information.");
 	}
 #endif
-	else if (! use_sonypi) {
-		if (apm_read(&cur_info) != 0)
-			error("Cannot read APM information.");
-	}
 	else {
 		if (sonypi_read(&cur_info) != 0)
 			error("Cannot read sonypi information.");
@@ -583,10 +579,7 @@ void check_battery_num(int real, int req
 int main(int argc, char *argv[]) {
 	make_window(parse_commandline(argc, argv), argc ,argv);
 
-	/*  Check for APM support (returns 0 on success). */
-	if (apm_exists() == 0) {
-		if (! delay)
-			delay = 1;
+	if (0) {
 	}
 #ifdef HAL
 	/* Check for hal support. */