Module Name:    src
Committed By:   jruoho
Date:           Sun Apr 25 06:24:38 UTC 2010

Modified Files:
        src/share/man/man4: acpilid.4

Log Message:
Update this too. As the page was so laconic, and as there is little to write
about the driver, add an example on howto put the system into sleep when the
lid is closed.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/share/man/man4/acpilid.4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man4/acpilid.4
diff -u src/share/man/man4/acpilid.4:1.3 src/share/man/man4/acpilid.4:1.4
--- src/share/man/man4/acpilid.4:1.3	Wed Apr 30 13:10:53 2008
+++ src/share/man/man4/acpilid.4	Sun Apr 25 06:24:38 2010
@@ -1,4 +1,4 @@
-.\" $NetBSD: acpilid.4,v 1.3 2008/04/30 13:10:53 martin Exp $
+.\" $NetBSD: acpilid.4,v 1.4 2010/04/25 06:24:38 jruoho Exp $
 .\"
 .\" Copyright (c) 2002, 2004 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -24,7 +24,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd April 25, 2004
+.Dd April 25, 2010
 .Dt ACPILID 4
 .Os
 .Sh NAME
@@ -35,14 +35,55 @@
 .Sh DESCRIPTION
 The
 .Nm
-driver supports ACPI Lid switches.
-Actions against lid open/close events can be configured using the
+driver supports
+.Tn ACPI
+.Dq lid switches .
+The
 .Xr powerd 8
-daemon.
+daemon can be used to control actions against
+the events of opening or closing the lid.
+The used script is
+.Pa /etc/powerd/scripts/lid_switch ,
+and the events are either
+.Em pressed
+(the lid was closed)
+or
+.Em released
+(the lid was opened).
 .Sh SEE ALSO
 .Xr acpi 4 ,
-.\" .Xr sysmon 4 ,
-.Xr powerd 8
+.Xr powerd 8 ,
+.Xr sysmon_pswitch 9
+.Sh EXAMPLES
+The following example modifies the mentioned script in order to put the
+system into
+.Pq Tn S3
+sleep when the lid is closed:
+.Bd -literal -offset indent
+\&...
+
+case "${2}" in
+pressed)
+        logger -p info "${0}: suspending..."
+
+        # As in sleep_button, kill some daemons.
+        #
+        /etc/rc.d/dhcpcd stop
+        /etc/rc.d/network stop
+        /etc/rc.d/wpa_supplicant stop
+
+        # Suspend.
+        #
+        /sbin/sysctl -w machdep.sleep_state=3
+
+        # Waking up.
+        #
+        /etc/rc.d/wpa_supplicant start
+        /etc/rc.d/network start
+        /etc/rc.d/dhcpcd start
+
+\&...
+.Ed
 .Sh HISTORY
 The
 .Nm

Reply via email to