shithub: bar

Download patch

ref: 12b23a6f1be6a835a3ce0cbeac02b5d023068499
parent: 595e1948331d24bb2ff576f47b744f938d2d7021
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Wed Sep 7 19:17:32 EDT 2022

try /dev/battery; increase battery polling period to 30s (was 10s)

--- a/bar.c
+++ b/bar.c
@@ -301,7 +301,8 @@
 		Bterm(b);
 	}
 
-	bat = open("/mnt/pm/battery", OREAD);
+	if((bat = open("/mnt/pm/battery", OREAD)) < 0)
+		bat = open("/dev/battery", OREAD);
 	if(initdraw(nil, nil, "bar") < 0)
 		sysfatal("initdraw: %r");
 	f = display->defaultfont;
@@ -370,7 +371,7 @@
 		if(0){
 		case Etimer:
 			t = nanosec();
-			if(t - oldt >= 10000000000ULL){
+			if(t - oldt >= 30000000000ULL){
 				readbattery();
 				oldt = t;
 			}