apm(4) only gives an estimate of remaining battery lifetime in minutes,
so let's not pretend that we have seconds granularity and end up always
printing :00.  Note that we're calculating the remaining seconds as
follows:

   251      if (batt_info->status != CS_CHARGING) {
   252          batt_info->seconds_remaining = apm_info.minutes_left * 60;
   253      }

Index: Makefile
===================================================================
RCS file: /var/cvs/ports/x11/i3status/Makefile,v
retrieving revision 1.42
diff -u -p -r1.42 Makefile
--- Makefile    31 Jan 2017 18:47:56 -0000      1.42
+++ Makefile    2 Feb 2017 04:19:31 -0000
@@ -5,7 +5,7 @@ ONLY_FOR_ARCHS=         ${APM_ARCHS}
 COMMENT=               generate a statusbar for use with i3/xmobar/dzen2
 
 DISTNAME=              i3status-2.11
-REVISION=              0
+REVISION=              1
 CATEGORIES=            x11 sysutils
 
 HOMEPAGE=              http://i3wm.org/i3status/
Index: patches/patch-src_print_battery_info_c
===================================================================
RCS file: patches/patch-src_print_battery_info_c
diff -N patches/patch-src_print_battery_info_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_print_battery_info_c      2 Feb 2017 04:15:31 -0000
@@ -0,0 +1,12 @@
+$OpenBSD$
+--- src/print_battery_info.c.orig      Thu Feb  2 05:15:15 2017
++++ src/print_battery_info.c   Thu Feb  2 05:14:43 2017
+@@ -482,7 +482,7 @@ void print_battery_info(yajl_gen json_gen, char *buffe
+     /* These OSes report battery stats in whole percent. */
+     integer_battery_capacity = true;
+ #endif
+-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || 
defined(__DragonFly__)
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || 
defined(__DragonFly__) || defined(__OpenBSD__)
+     /* These OSes report battery time in minutes. */
+     hide_seconds = true;
+ #endif

Reply via email to