Home | History | Annotate | Line # | Download | only in scripts
lid_switch revision 1.3
      1  1.1   mycroft #!/bin/sh -
      2  1.1   mycroft #
      3  1.3  jmcneill #	$NetBSD: lid_switch,v 1.3 2006/09/26 02:17:38 jmcneill Exp $
      4  1.1   mycroft #
      5  1.2   mycroft # Generic script for lid switch events.  We do nothing for now.
      6  1.1   mycroft #
      7  1.1   mycroft # Arguments passed by powerd(8):
      8  1.1   mycroft #
      9  1.1   mycroft #	device event
     10  1.1   mycroft 
     11  1.1   mycroft case "${2}" in
     12  1.3  jmcneill pressed)
     13  1.3  jmcneill 	if /etc/rc.d/apmd status >/dev/null ; then
     14  1.3  jmcneill 		/usr/sbin/apm -S
     15  1.3  jmcneill 	else
     16  1.3  jmcneill 		/usr/sbin/apm -d -S
     17  1.3  jmcneill 	fi
     18  1.3  jmcneill 	exit 0
     19  1.3  jmcneill 	;;
     20  1.3  jmcneill released)
     21  1.3  jmcneill 	;;
     22  1.1   mycroft *)
     23  1.3  jmcneill 	logger -p warning "${0}: unsupported event ${2} on device ${1}" >&1
     24  1.1   mycroft 	exit 1
     25  1.1   mycroft esac
     26