From ac50edb2d8b8e2773369b50fd3bc121aba1a25df Mon Sep 17 00:00:00 2001 From: jmc Date: Sun, 13 Feb 2022 21:27:51 +0000 Subject: [PATCH] - for -a, get the brackets right - for -l and -m remove the brackets - note that -m whilst charging now displays estimated recharge time - A/C -> AC from jan stary; tweaked a little by myself --- usr.sbin/apm/apm.8 | 11 ++++++----- usr.sbin/apm/apm.c | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/usr.sbin/apm/apm.8 b/usr.sbin/apm/apm.8 index 675ac54ca5c..ed110e11f14 100644 --- a/usr.sbin/apm/apm.8 +++ b/usr.sbin/apm/apm.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: apm.8,v 1.44 2021/11/03 19:54:28 jmc Exp $ +.\" $OpenBSD: apm.8,v 1.45 2022/02/13 21:27:51 jmc Exp $ .\" .\" Copyright (c) 1996 John T. Kohl .\" All rights reserved. @@ -26,7 +26,7 @@ .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 3 2021 $ +.Dd $Mdocdate: February 13 2022 $ .Dt APM 8 .Os .Sh NAME @@ -59,7 +59,7 @@ The options are as follows: .It Fl A Switch to automatic performance adjustment mode (the default). .It Fl a -Display the external charger (A/C status). +Display the external charger (AC) status. 0 means disconnected, 1 means connected, 2 means backup power source, and 255 means unknown. .It Fl b @@ -82,9 +82,10 @@ setting .Va hw.setperf to 0. .It Fl l -Display the estimated battery lifetime (in percent). +Display the estimated battery lifetime, in percent. .It Fl m -Display the estimated battery lifetime (in minutes). +Display the estimated battery lifetime, in minutes. +If charging, the estimated time to fully charge is displayed instead. .It Fl P Display the performance adjustment mode. 0 means manual mode. diff --git a/usr.sbin/apm/apm.c b/usr.sbin/apm/apm.c index eb66acdc246..8c5662957c6 100644 --- a/usr.sbin/apm/apm.c +++ b/usr.sbin/apm/apm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apm.c,v 1.40 2022/02/06 09:07:42 robert Exp $ */ +/* $OpenBSD: apm.c,v 1.41 2022/02/13 21:27:51 jmc Exp $ */ /* * Copyright (c) 1996 John T. Kohl @@ -394,7 +394,7 @@ balony: } if (doac) - printf("A/C adapter state: %s\n", + printf("AC adapter state: %s\n", ac_state(reply.batterystate.ac_state)); if (doperf) -- 2.20.1