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