[Midnightbsd-cvs] src: src/usr.bin: Add batt, a rudimentary command to check the battery

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sat Aug 16 23:56:14 EDT 2008


Log Message:
-----------
Add batt, a rudimentary command to check the battery life on systems including batteries (typically laptops) that report via ACPI. 

This command only reports information visible by sysctl.

Modified Files:
--------------
    src/usr.bin:
        Makefile (r1.14 -> r1.15)

Added Files:
-----------
    src/usr.bin/batt:
        Makefile (r1.1)
        batt.1 (r1.1)
        batt.sh (r1.1)

-------------- next part --------------
Index: Makefile
===================================================================
RCS file: /home/cvs/src/usr.bin/Makefile,v
retrieving revision 1.14
retrieving revision 1.15
diff -L usr.bin/Makefile -L usr.bin/Makefile -u -r1.14 -r1.15
--- usr.bin/Makefile
+++ usr.bin/Makefile
@@ -16,6 +16,7 @@
 	awk \
 	banner \
 	basename \
+	batt \
 	bc \
 	biff \
 	${_bluetooth} \
--- /dev/null
+++ usr.bin/batt/batt.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+sysctl -a | grep hw.acpi.batt | cut -c 9-30
--- /dev/null
+++ usr.bin/batt/batt.1
@@ -0,0 +1,49 @@
+.\" Copyright (c) 2008 Lucas Holt
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $MidnightBSD: src/usr.bin/batt/batt.1,v 1.1 2008/08/17 03:56:12 laffer1 Exp $
+.\"
+.Dd August 16, 2008
+.Dt BATT 1
+.Os
+.Sh NAME
+.Nm batt
+.Nd "battery status and life"
+.Sh DESCRIPTION
+The
+.Nm
+command prints the current status of batteries connected on
+ACPI capable systems. This does not include CMOS batteries.
+.Pp
+.Sh HISTORY
+The
+.Nm
+command first appeared in
+.Mx 0.3 .
+.Sh AUTHORS
+This
+manual page was written by
+.An Lucas Holt Aq luke at MidnightBSD.org .
+.Sh BUGS
+This program only works on systems with ACPI battery status.
--- /dev/null
+++ usr.bin/batt/Makefile
@@ -0,0 +1,6 @@
+# $MidnightBSD: src/usr.bin/batt/Makefile,v 1.1 2008/08/17 03:56:12 laffer1 Exp $
+
+SCRIPTS=batt.sh
+MAN=	batt.1
+
+.include <bsd.prog.mk>


More information about the Midnightbsd-cvs mailing list