Subject: Re: Call for testers: power management branch
To: None <>
From: Joerg Sonnenberger <>
List: current-users
Date: 11/27/2007 18:33:11
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Tue, Nov 27, 2007 at 09:17:09AM -0800, Kevin Lahey wrote:
> Woo hoo!  My machine successfully suspended and (more importantly)
> resumed!  It looks like I managed to kill off X with my suspend, but I
> presume that I can scour the archives to figure that part out.  Thanks
> so much, and thanks so much for knocking out a fix so quickly!

Use something like the attached script for powerd.


Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=lid_switch

#!/bin/sh -
#	$NetBSD: lid_switch,v 1.4 2006/09/27 01:41:45 jnemeth 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
	curtty=$(/usr/sbin/wsconscfg -g)
	/usr/sbin/wsconscfg -s 1
	/sbin/sysctl -w machdep.sleep_state=3
	/usr/sbin/wsconscfg -s ${curtty}
	exit 0
	logger -p warning "${0}: unsupported event ${2} on device ${1}" >&1
	exit 1