Merge branch 'vendor/TNFTP'
[dragonfly.git] / usr.sbin / battd / battd.8
1 .\" Copyright (c) 2005 The DragonFly Project.  All rights reserved.
2 .\"
3 .\" This code is derived from software contributed to The DragonFly Project
4 .\" by Maxime Labelle.
5 .\"
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
8 .\" are met:
9 .\"
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\"    notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\"    notice, this list of conditions and the following disclaimer in
14 .\"    the documentation and/or other materials provided with the
15 .\"    distribution.
16 .\" 3. Neither the name of The DragonFly Project nor the names of its
17 .\"    contributors may be used to endorse or promote products derived
18 .\"    from this software without specific, prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 .\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23 .\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
24 .\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25 .\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
26 .\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27 .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
28 .\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 .\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
30 .\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 .\" SUCH DAMAGE.
32 .\"
33 .\" $DragonFly: src/usr.sbin/battd/battd.8,v 1.13 2008/02/22 04:30:34 swildner Exp $
34 .Dd April 6, 2009
35 .Dt BATTD 8
36 .Os
37 .Sh NAME
38 .Nm battd
39 .Nd Battery status monitoring daemon
40 .Sh SYNOPSIS
41 .Nm
42 .Op Fl dEhT
43 .Op Fl c Ar seconds
44 .Op Fl e Ar command
45 .Op Fl f Ar device
46 .Op Fl p Ar percent
47 .Op Fl s Ar status
48 .Op Fl t Ar minutes
49 .Sh DESCRIPTION
50 The
51 .Nm
52 daemon monitors the status of the battery or batteries present in the system.
53 The daemon will alert all users on the system and may execute a supplied
54 command once a particular criterion has been met.
55 The criteria are based
56 on the percentage remaining, the time remaining and the status of the battery.
57 .Pp
58 The options are as follows:
59 .Bl -tag -width indent
60 .It Fl c Ar seconds
61 Interval in seconds for checking the battery status.
62 Default is
63 .Ar 30
64 seconds.
65 .It Fl d
66 Start in debug mode (works when
67 .Nm
68 is compiled with
69 .Fl DDEBUG ) .
70 .It Fl e Ar command
71 Execute
72 .Ar command
73 once condition has been met.
74 .It Fl E
75 Execute command only once after a condition has been met.
76 .It Fl f Ar device
77 Specifies a different device path to be used.
78 Default is
79 .Pa /dev/apm .
80 .It Fl h
81 Print
82 .Nm
83 command line usage and exit.
84 .It Fl p Ar percent
85 Alert users when the remaining battery life has reached approximately
86 .Ar percent .
87 Default is
88 .Ar 10 .
89 A value of
90 .Ar 0
91 turns this alert off.
92 .It Fl s Ar status
93 Alert users when the remaining battery has reached a given status.
94 The status specified can either be
95 .Ar high ,
96 .Ar low
97 or
98 .Ar critical .
99 .It Fl t Ar minutes
100 Alert users when the remaining battery time has reached approximately
101 .Ar minutes .
102 .It Fl T
103 Alert users when the system has approximately 10 minutes remaining battery time,
104 but don't execute command
105 .Pq Fl e
106 on this alert.
107 .El
108 .Sh EXAMPLES
109 .Dl "battd -p 50 -s low"
110 Alert users when the battery percentage has reached 50% and
111 once again when the status reaches
112 .Ar low .
113 .Pp
114 .Dl "battd -t 15 -c 10"
115 Alert users when the battery has 15 minutes worth of power remaining
116 and once again when battery percentage has reached 10%.
117 Decrease the interval between checking the battery to 10 seconds.
118 .Pp
119 .Dl "battd -Tt4 -p0 -Ee \*q/sbin/shutdown -p +2 Battery_Low\*q"
120 Alert users when the battery has 10 minutes worth power remaining and
121 alert again when 4 minutes is remaining and then execute the given
122 .Xr shutdown 8
123 command once.
124 (User will have to
125 .Xr kill 1
126 the
127 .Xr shutdown 8
128 process, if AC power is connected to system and shutdown isn't wanted.)
129 .Sh SEE ALSO
130 .Xr viapm 4 ,
131 .Xr apm 8 ,
132 .Xr apmd 8 ,
133 .Xr syslogd 8 ,
134 .Xr zzz 8
135 .Sh HISTORY
136 The
137 .Nm
138 command first appeared in
139 .Dx 1.1 .
140 .Sh AUTHORS
141 .An Liam J. Foy Aq liamfoy@dragonflybsd.org
142 .Pp
143 Man page contributions by:
144 .An Maxime Labelle Aq mlabelle@vt220.com
145 .An Sarunas Vancevicius Aq svan@redbrick.dcu.ie