summaryrefslogtreecommitdiff
path: root/community/tint2/add-power-now-support.patch
blob: 5057043dfe79822e22bfe8b4e3caed6dabcf78e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
diff -rup ../tint2-0.11.orig/src/battery/battery.c ./src/battery/battery.c
--- ../tint2-0.11.orig/src/battery/battery.c	2010-12-02 23:56:11.313403140 +0100
+++ ./src/battery/battery.c	2010-12-02 23:57:22.266956142 +0100
@@ -184,8 +184,14 @@ void init_battery()
 		}
 		g_free(path2);
 	}
-	if (path_energy_now && path_energy_full) {
+
+	path_current_now = g_build_filename(battery_dir, "power_now", NULL);
+	if (!g_file_test (path_current_now, G_FILE_TEST_EXISTS)) {
+		g_free(path_current_now);
 		path_current_now = g_build_filename(battery_dir, "current_now", NULL);
+	}
+
+	if (path_energy_now && path_energy_full) {
 		path_status = g_build_filename(battery_dir, "status", NULL);
 
 		// check file