xref: /openbsd-src/usr.sbin/apm/apm.8 (revision ac50edb2d8b8e2773369b50fd3bc121aba1a25df)
1.\"	$OpenBSD: apm.8,v 1.45 2022/02/13 21:27:51 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: February 13 2022 $
30.Dt APM 8
31.Os
32.Sh NAME
33.Nm apm ,
34.Nm zzz ,
35.Nm ZZZ
36.Nd Advanced Power Management control program
37.Sh SYNOPSIS
38.Nm apm
39.Op Fl AabHLlmPSvZz
40.Op Fl f Ar sockname
41.Nm zzz
42.Op Fl SZz
43.Op Fl f Ar sockname
44.Nm ZZZ
45.Op Fl SZz
46.Op Fl f Ar sockname
47.Sh DESCRIPTION
48.Nm
49communicates with the Advanced Power Management daemon,
50.Xr apmd 8 ,
51making requests of it for current power status or to place the system
52into a suspend or stand-by state.
53With no flags,
54.Nm
55displays the current power management state in verbose form.
56.Pp
57The options are as follows:
58.Bl -tag -width Ds
59.It Fl A
60Switch to automatic performance adjustment mode (the default).
61.It Fl a
62Display the external charger (AC) status.
630 means disconnected, 1
64means connected, 2 means backup power source, and 255 means unknown.
65.It Fl b
66Display the battery status.
670 means high, 1 means low, 2 means
68critical, 3 means charging, 4 means absent, and 255 means unknown.
69.It Fl f Ar sockname
70Set the name of the socket via which to contact
71.Xr apmd 8
72to
73.Ar sockname .
74.It Fl H
75Switch to manual performance adjustment mode,
76setting
77.Va hw.setperf
78to 100.
79.It Fl L
80Switch to manual performance adjustment mode,
81setting
82.Va hw.setperf
83to 0.
84.It Fl l
85Display the estimated battery lifetime, in percent.
86.It Fl m
87Display the estimated battery lifetime, in minutes.
88If charging, the estimated time to fully charge is displayed instead.
89.It Fl P
90Display the performance adjustment mode.
910 means manual mode.
921 means automatic mode.
93.It Fl S
94Put the system into stand-by (light sleep) state.
95.It Fl v
96Request more verbose description of the displayed states.
97.It Fl Z
98Put the system into hibernation.
99System memory is saved to disk (swap space)
100and the machine is powered down.
101For machines supporting the
102.Xr acpi 4
103style hibernate functionality, on resume a full kernel
104boot will occur, followed by the reading of the saved
105memory image.
106The image will then be unpacked and the system resumed
107at the point immediately after the hibernation request.
108.It Fl z
109Put the system into suspend (deep sleep) state.
110.El
111.Pp
112The
113.Nm zzz
114and
115.Nm ZZZ
116commands are shortcuts for suspending and hibernating the system,
117respectively.
118With no arguments,
119they are placed into their respective states.
120The command line flags serve the same purpose as for
121.Nm .
122.Pp
123These commands do not wait for positive confirmation that the requested
124state has been entered; to do so would mean the command does not return
125until the system resumes from its sleep state.
126.Pp
127Each system provides methods for waking from suspend or hibernate.
128For those machines supporting
129.Xr acpi 4
130style suspend/resume (or hibernate/unhibernate) semantics, the wakeup
131devices for each sleep state are printed during system boot in
132.Xr dmesg 8 .
133.Pp
134The system will attempt to provide as much feedback as is possible on
135the specific hardware being suspended/resumed.
136This includes setting system LEDs or other indicators
137to illustrate progress throughout the suspend/resume
138(or hibernate/unhibernate) process.
139Such feedback is machine-dependent.
140.Sh FILES
141.Bl -tag -width /var/run/apmdev -compact
142.It Pa /var/run/apmdev
143The
144default
145.Ux Ns -domain
146socket for communicating with
147.Xr apmd 8 .
148The
149.Fl f
150flag may be used to specify an alternate socket name.
151The protection modes on this socket govern which users may access the
152APM functions.
153.El
154.Sh SEE ALSO
155.Xr apm 4 ,
156.Xr apmd 8
157.Pp
158Advanced Power Management (APM) BIOS Interface Specification
159(revision 1.2),
160Intel Corporation and Microsoft Corporation
161.Sh HISTORY
162The
163.Nm
164command appeared in
165.Nx 1.3 ;
166.Ox
167support was added in
168.Ox 1.2 .
169