11.1Smycroft#!/bin/sh -
21.1Smycroft#
31.9Sjruoho#	$NetBSD: lid_switch,v 1.9 2010/12/31 09:33:10 jruoho Exp $
41.1Smycroft#
51.9Sjruoho# Generic script for lid switch events.
61.1Smycroft#
71.1Smycroft# Arguments passed by powerd(8):
81.1Smycroft#
91.1Smycroft#	device event
101.1Smycroft
111.1Smycroftcase "${2}" in
121.3Sjmcneillpressed)
131.9Sjruoho
141.9Sjruoho	# If you want to put the system into sleep when the lid
151.9Sjruoho	# is closed, see the sleep_button -script for examples.
161.9Sjruoho	#
171.6Smacallan	wsconsctl -d -w backlight=0 >/dev/null
181.3Sjmcneill	exit 0
191.3Sjmcneill	;;
201.9Sjruoho
211.3Sjmcneillreleased)
221.8Smacallan	wsconsctl -d -w backlight=1 >/dev/null
231.6Smacallan	exit 0
241.3Sjmcneill	;;
251.9Sjruoho
261.1Smycroft*)
271.3Sjmcneill	logger -p warning "${0}: unsupported event ${2} on device ${1}" >&1
281.1Smycroft	exit 1
291.1Smycroftesac
30