1 1.1 mycroft #!/bin/sh - 2 1.1 mycroft # 3 1.8 macallan # $NetBSD: lid_switch,v 1.8 2010/10/28 02:06:02 macallan Exp $ 4 1.1 mycroft # 5 1.4 jnemeth # Generic script for lid switch events. We try to put the system to sleep. 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.8 macallan #if /etc/rc.d/apmd status >/dev/null ; then 14 1.5 jmcneill # /usr/sbin/apm -S 15 1.5 jmcneill #else 16 1.5 jmcneill # /usr/sbin/apm -d -S 17 1.5 jmcneill #fi 18 1.6 macallan wsconsctl -d -w backlight=0 >/dev/null 19 1.3 jmcneill exit 0 20 1.3 jmcneill ;; 21 1.3 jmcneill released) 22 1.8 macallan wsconsctl -d -w backlight=1 >/dev/null 23 1.6 macallan exit 0 24 1.3 jmcneill ;; 25 1.1 mycroft *) 26 1.3 jmcneill logger -p warning "${0}: unsupported event ${2} on device ${1}" >&1 27 1.1 mycroft exit 1 28 1.1 mycroft esac 29