xref: /openbsd/usr.sbin/apm/apm.8 (revision 891d7ab6)
1.\"	$OpenBSD: apm.8,v 1.35 2010/09/19 21:59:23 jmc Exp $
2.\"
3.\" Copyright (c) 1996 John T. Kohl
4.\" All rights reserved.
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.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. The name of the author may not be used to endorse or promote products
15.\"    derived from this software without specific prior written permission.
16.\"
17.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS'' AND ANY EXPRESS OR
18.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20.\" DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
21.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
25.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
26.\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27.\" POSSIBILITY OF SUCH DAMAGE.
28.\"
29.Dd $Mdocdate: September 19 2010 $
30.Dt APM 8
31.Os
32.Sh NAME
33.Nm apm
34.Nd Advanced Power Management control program
35.Sh SYNOPSIS
36.Nm zzz
37.Op Fl Sz
38.Op Fl f Ar sockname
39.Nm apm
40.Op Fl AabCHLlmPSvz
41.Op Fl f Ar sockname
42.Sh DESCRIPTION
43.Nm
44communicates with the Advanced Power Management daemon,
45.Xr apmd 8 ,
46making requests of it for current power status or to place the system
47into a suspend or stand-by state.
48With no flags,
49.Nm
50displays the current power management state in verbose form.
51.Pp
52The options are as follows:
53.Bl -tag -width Ds
54.It Fl A
55Set
56.Xr apmd 8
57to automatic performance adjustment mode.
58In this mode, when CPU idle time falls below 10%,
59or if the AC power is connected and the battery is more than 15% charged,
60.Nm
61raises
62.Va hw.setperf
63to 100.
64Otherwise when CPU idle time is above 30%
65and the system is running on battery power,
66.Nm
67lowers
68.Va hw.setperf
69as much as possible to reduce power consumption.
70.It Fl a
71Display the external charger (A/C status).
720 means disconnected, 1
73means connected, 2 means backup power source, and 255 means unknown.
74.It Fl b
75Display the battery status.
760 means high, 1 means low, 2 means
77critical, 3 means charging, 4 means absent, and 255 means unknown.
78.It Fl C
79Set
80.Xr apmd 8
81to cool running performance adjustment mode.
82In this mode, when CPU idle time falls below 10%,
83.Nm
84raises
85.Va hw.setperf
86as much as necessary.
87Otherwise when CPU idle time is above 30%,
88.Nm
89lowers
90.Va hw.setperf
91as much as possible to reduce heat, noise, and power consumption.
92.It Fl f Ar sockname
93Set the name of the socket via which to contact
94.Xr apmd 8
95to
96.Pa sockname .
97.It Fl H
98Set
99.Xr apmd 8
100to manual performance adjustment mode and
101.Va hw.setperf
102to 100.
103.It Fl L
104Set
105.Xr apmd 8
106to manual performance adjustment mode and
107.Va hw.setperf
108to 0.
109.It Fl l
110Display the estimated battery lifetime (in percent).
111.It Fl m
112Display the estimated battery lifetime (in minutes).
113.It Fl P
114Display the performance adjustment mode.
1150 means manual mode, 1 means automatic mode, and 2 means cool running mode.
116.It Fl S
117Put the system into stand-by (light sleep) state.
118.It Fl v
119Request more verbose description of the displayed states.
120.It Fl z
121Put the system into suspend (deep sleep) state.
122.El
123.Pp
124The
125.Nm zzz
126variant of this command is an alternative for suspending the system.
127With no arguments,
128.Nm zzz
129places the system into suspend state.
130The command line flags serve the same purpose as for the
131.Nm
132variant of this command.
133.Pp
134This command does not wait for positive confirmation that the requested
135state has been entered; to do so would mean the command does not return
136until the system resumes from its sleep state.
137.Sh FILES
138.Bl -tag -width /var/run/apmdev -compact
139.It Pa /var/run/apmdev
140default
141.Ux Ns -domain
142socket for communicating with
143.Xr apmd 8
144.El
145.Pp
146The
147.Fl f
148flag may be used to specify an alternate socket name.
149The protection modes on this socket govern which users may access the
150APM functions.
151.Sh SEE ALSO
152.Xr apm 4 ,
153.Xr apmd 8
154.Pp
155Advanced Power Management (APM) BIOS Interface Specification
156(revision 1.2),
157Intel Corporation and Microsoft Corporation
158.Sh HISTORY
159The
160.Nm
161command appeared in
162.Nx 1.3 ,
163.Ox
164support was added in
165.Ox 1.2 .
166