xref: /openbsd/usr.sbin/apm/apm.8 (revision 7b36286a)
1.\"	$OpenBSD: apm.8,v 1.32 2007/12/05 19:49:33 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: December 5 2007 $
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.Br
40.Nm apm
41.Op Fl AabCHLlmPSvz
42.Op Fl f Ar sockname
43.Sh DESCRIPTION
44.Nm
45communicates with the Advanced Power Management daemon,
46.Xr apmd 8 ,
47making requests of it for current power status or to place the system
48into a suspend or stand-by state.
49With no flags,
50.Nm
51displays the current power management state in verbose form.
52.Pp
53The options are as follows:
54.Bl -tag -width Ds
55.It Fl A
56Set
57.Xr apmd 8
58to automatic performance adjustment mode.
59In this mode, when CPU idle time falls below 10%,
60or if the AC power is connected and the battery is more than 15% charged,
61.Nm
62raises
63.Va hw.setperf
64to 100.
65Otherwise when CPU idle time is above 30%
66and the system is running on battery power,
67.Nm
68lowers
69.Va hw.setperf
70as much as possible to reduce power consumption.
71.It Fl a
72Display the external charger (A/C status).
730 means disconnected, 1
74means connected, 2 means backup power source, and 255 means unknown.
75.It Fl b
76Display the battery status.
770 means high, 1 means low, 2 means
78critical, 3 means charging, 4 means absent, and 255 means unknown.
79.It Fl C
80Set
81.Xr apmd 8
82to cool running performance adjustment mode.
83In this mode, when CPU idle time falls below 10%,
84.Nm
85raises
86.Va hw.setperf
87as much as necessary.
88Otherwise when CPU idle time is above 30%,
89.Nm
90lowers
91.Va hw.setperf
92as much as possible to reduce heat, noise, and power consumption.
93.It Fl f Ar sockname
94Set the name of the socket via which to contact
95.Xr apmd 8
96to
97.Pa sockname .
98.It Fl H
99Set
100.Xr apmd 8
101to manual performance adjustment mode and
102.Va hw.setperf
103to 100.
104.It Fl L
105Set
106.Xr apmd 8
107to manual performance adjustment mode and
108.Va hw.setperf
109to 0.
110.It Fl l
111Display the estimated battery lifetime (in percent).
112.It Fl m
113Display the estimated battery lifetime (in minutes).
114.It Fl P
115Display the performance adjustment mode.
1160 means manual mode, 1 means automatic mode, and 2 means cool running mode.
117.It Fl S
118Put the system into stand-by (light sleep) state.
119.It Fl v
120Request more verbose description of the displayed states.
121.It Fl z
122Put the system into suspend (deep sleep) state.
123.El
124.Pp
125The
126.Nm zzz
127variant of this command is an alternative for suspending the system.
128With no arguments,
129.Nm zzz
130places the system into suspend state.
131The command line flags serve the same purpose as for the
132.Nm
133variant of this command.
134.Pp
135This command does not wait for positive confirmation that the requested
136state has been entered; to do so would mean the command does not return
137until the system resumes from its sleep state.
138.Sh FILES
139.Bl -tag -width /var/run/apmdev -compact
140.It Pa /var/run/apmdev
141default Unix domain socket for communicating with
142.Xr apmd 8
143.El
144.Pp
145The
146.Fl f
147flag may be used to specify an alternate socket name.
148The protection modes on this socket govern which users may access the
149APM functions.
150.Sh SEE ALSO
151.Xr apm 4 ,
152.Xr apmd 8
153.Pp
154Advanced Power Management (APM) BIOS Interface Specification
155(revision 1.2),
156Intel Corporation and Microsoft Corporation
157.Sh HISTORY
158The
159.Nm
160command appeared in
161.Nx 1.3 ,
162.Ox
163support was added in
164.Ox 1.2 .
165