[BACK]Return to lid_switch CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / etc / powerd / scripts

File: [cvs.NetBSD.org] / src / etc / powerd / scripts / lid_switch (download)

Revision 1.5, Fri Jun 20 02:38:00 2008 UTC (15 years, 10 months ago) by jmcneill
Branch: MAIN
CVS Tags: wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, wrstuden-revivesa-base-1, wrstuden-revivesa-base, netbsd-5-base, netbsd-5-2-RELEASE, netbsd-5-2-RC1, netbsd-5-2-3-RELEASE, netbsd-5-2-2-RELEASE, netbsd-5-2-1-RELEASE, netbsd-5-2, netbsd-5-1-RELEASE, netbsd-5-1-RC4, netbsd-5-1-RC3, netbsd-5-1-RC2, netbsd-5-1-RC1, netbsd-5-1-5-RELEASE, netbsd-5-1-4-RELEASE, netbsd-5-1-3-RELEASE, netbsd-5-1-2-RELEASE, netbsd-5-1-1-RELEASE, netbsd-5-1, netbsd-5-0-RELEASE, netbsd-5-0-RC4, netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-RC1, netbsd-5-0-2-RELEASE, netbsd-5-0-1-RELEASE, netbsd-5-0, netbsd-5, mjf-devfs2-base2, mjf-devfs2-base, matt-premerge-20091211, matt-nb5-pq3-base, matt-nb5-pq3, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-premerge-20091211, matt-nb5-mips64-k15, matt-nb5-mips64, matt-nb4-mips64-k7-u2a-k9b, matt-mips64-base2, jym-xensuspend-nbase, jym-xensuspend-base, jym-xensuspend
Changes since 1.4: +6 -6 lines

Don't try to standby on a lid_switch pressed event, this has a few problems:
  1. ACPI S1 doesn't work properly for many people on NetBSD
  2. It prevents someone from using their laptop with an external display

#!/bin/sh -
#
#	$NetBSD: lid_switch,v 1.5 2008/06/20 02:38:00 jmcneill Exp $
#
# Generic script for lid switch events.  We try to put the system to sleep.
#
# Arguments passed by powerd(8):
#
#	device event

case "${2}" in
pressed)
	#if /etc/rc.d/apmd status >/dev/null ; then
	#	/usr/sbin/apm -S
	#else
	#	/usr/sbin/apm -d -S
	#fi
	exit 0
	;;
released)
	;;
*)
	logger -p warning "${0}: unsupported event ${2} on device ${1}" >&1
	exit 1
esac