1.\" $OpenBSD: apm.8,v 1.43 2015/08/04 09:22:19 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: August 4 2015 $ 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. 61.It Fl a 62Display the external charger (A/C 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 75Set 76.Va hw.setperf 77to 100. 78.It Fl L 79Set 80.Va hw.setperf 81to 0. 82.It Fl l 83Display the estimated battery lifetime (in percent). 84.It Fl m 85Display the estimated battery lifetime (in minutes). 86.It Fl P 87Display the performance adjustment mode. 880 means manual mode. 891 means automatic mode. 90.It Fl S 91Put the system into stand-by (light sleep) state. 92.It Fl v 93Request more verbose description of the displayed states. 94.It Fl Z 95Put the system into hibernation. 96System memory is saved to disk (swap space) 97and the machine is powered down. 98For machines supporting the 99.Xr acpi 4 100style hibernate functionality, on resume a full kernel 101boot will occur, followed by the reading of the saved 102memory image. 103The image will then be unpacked and the system resumed 104at the point immediately after the hibernation request. 105.It Fl z 106Put the system into suspend (deep sleep) state. 107.El 108.Pp 109The 110.Nm zzz 111and 112.Nm ZZZ 113commands are shortcuts for suspending and hibernating the system, 114respectively. 115With no arguments, 116they are placed into their respective states. 117The command line flags serve the same purpose as for 118.Nm . 119.Pp 120These commands do not wait for positive confirmation that the requested 121state has been entered; to do so would mean the command does not return 122until the system resumes from its sleep state. 123.Pp 124Each system provides methods for waking from suspend or hibernate. 125For those machines supporting 126.Xr acpi 4 127style suspend/resume (or hibernate/unhibernate) semantics, the wakeup 128devices for each sleep state are printed during system boot in 129.Xr dmesg 8 . 130.Pp 131The system will attempt to provide as much feedback as is possible on 132the specific hardware being suspended/resumed. 133This includes setting system LEDs or other indicators 134to illustrate progress throughout the suspend/resume 135(or hibernate/unhibernate) process. 136Such feedback is machine-dependent. 137.Sh FILES 138.Bl -tag -width /var/run/apmdev -compact 139.It Pa /var/run/apmdev 140The 141default 142.Ux Ns -domain 143socket for communicating with 144.Xr apmd 8 . 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.El 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