shithub: bar

Download patch

ref: 473836c5ff5a94d1cd9cba0edb9d96f46a54be49
parent: bbcc115caba646716d1845a79230e2b60492a16c
parent:
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Wed Jan 13 04:06:15 EST 2021

do not call place() on every redraw

--- a/bar.c	Wed Jan 13 03:24:50 2021
+++ b/bar.c	Wed Jan 13 04:06:15 2021
@@ -129,7 +129,6 @@
 
 	snprint(s, sizeof(s), "%s%τ", bats[0] ? "100% │ " : "", tf);
 	width = stringwidth(f, s);
-	place();
 }
 
 static void
@@ -249,6 +248,7 @@
 
 	readbattery();
 	redraw();
+	place();
 	proccreate(updateproc, nil, 4096);
 
 	for(;;){
@@ -260,6 +260,7 @@
 			if(getwindow(display, Refnone) < 0)
 				sysfatal("getwindow: %r");
 			redraw();
+			place();
 			break;
 
 		case 2: