Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/share/man/man4 Update this too. As the page was so laconic, ...



details:   https://anonhg.NetBSD.org/src/rev/eaa1a68d1682
branches:  trunk
changeset: 754255:eaa1a68d1682
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Sun Apr 25 06:24:38 2010 +0000

description:
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.

diffstat:

 share/man/man4/acpilid.4 |  55 +++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 48 insertions(+), 7 deletions(-)

diffs (79 lines):

diff -r dd8c6f8eb59e -r eaa1a68d1682 share/man/man4/acpilid.4
--- a/share/man/man4/acpilid.4  Sun Apr 25 06:04:59 2010 +0000
+++ b/share/man/man4/acpilid.4  Sun Apr 25 06:24:38 2010 +0000
@@ -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



Home | Main Index | Thread Index | Old Index