xref: /netbsd-src/share/man/man4/acpilid.4 (revision 01869ca4d24a86379a68731bf9706a9f0820fe4e)
1.\" $NetBSD: acpilid.4,v 1.8 2017/07/03 21:30:58 wiz Exp $
2.\"
3.\" Copyright (c) 2002, 2004 The NetBSD Foundation, Inc.
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.\"
15.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
16.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
17.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
18.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
19.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25.\" POSSIBILITY OF SUCH DAMAGE.
26.\"
27.Dd January 9, 2011
28.Dt ACPILID 4
29.Os
30.Sh NAME
31.Nm acpilid
32.Nd ACPI Lid Switch
33.Sh SYNOPSIS
34.Cd "acpilid* at acpi?"
35.Sh DESCRIPTION
36The
37.Nm
38driver supports
39.Tn ACPI
40.Dq lid switches .
41The
42.Xr powerd 8
43daemon can be used to control actions against
44the events of opening or closing the lid.
45The script used is
46.Pa /etc/powerd/scripts/lid_switch ,
47and the events are either
48.Em pressed
49(the lid was closed)
50or
51.Em released
52(the lid was opened).
53.Sh EXAMPLES
54The following example modifies the mentioned script in order to put the
55system into
56.Pq Tn S3
57sleep when the lid is closed:
58.Bd -literal -offset indent
59\&...
60
61case "${2}" in
62pressed)
63        logger -p info "${0}: suspending..."
64
65        # As in sleep_button, kill some daemons.
66        #
67        /etc/rc.d/dhcpcd stop
68        /etc/rc.d/network stop
69        /etc/rc.d/wpa_supplicant stop
70
71        # Suspend.
72        #
73        if /sbin/sysctl hw.acpi.sleep.state >/dev/null 2>&1; then
74                /sbin/sysctl -w hw.acpi.sleep.state=3
75	fi
76
77        # Waking up.
78        #
79        /etc/rc.d/wpa_supplicant start
80        /etc/rc.d/network start
81        /etc/rc.d/dhcpcd start
82
83\&...
84.Ed
85.Sh SEE ALSO
86.Xr acpi 4 ,
87.Xr powerd 8 ,
88.Xr sysmon_pswitch 9
89.Sh HISTORY
90The
91.Nm
92driver
93appeared in
94.Nx 1.6 .
95