Home | History | Annotate | Line # | Download | only in scripts
      1 #!/bin/sh -
      2 #
      3 #	$NetBSD: lid_switch,v 1.9 2010/12/31 09:33:10 jruoho Exp $
      4 #
      5 # Generic script for lid switch events.
      6 #
      7 # Arguments passed by powerd(8):
      8 #
      9 #	device event
     10 
     11 case "${2}" in
     12 pressed)
     13 
     14 	# If you want to put the system into sleep when the lid
     15 	# is closed, see the sleep_button -script for examples.
     16 	#
     17 	wsconsctl -d -w backlight=0 >/dev/null
     18 	exit 0
     19 	;;
     20 
     21 released)
     22 	wsconsctl -d -w backlight=1 >/dev/null
     23 	exit 0
     24 	;;
     25 
     26 *)
     27 	logger -p warning "${0}: unsupported event ${2} on device ${1}" >&1
     28 	exit 1
     29 esac
     30