1 1.1 mycroft #!/bin/sh - 2 1.1 mycroft # 3 1.9 jruoho # $NetBSD: lid_switch,v 1.9 2010/12/31 09:33:10 jruoho Exp $ 4 1.1 mycroft # 5 1.9 jruoho # Generic script for lid switch events. 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.9 jruoho 14 1.9 jruoho # If you want to put the system into sleep when the lid 15 1.9 jruoho # is closed, see the sleep_button -script for examples. 16 1.9 jruoho # 17 1.6 macallan wsconsctl -d -w backlight=0 >/dev/null 18 1.3 jmcneill exit 0 19 1.3 jmcneill ;; 20 1.9 jruoho 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.9 jruoho 26 1.1 mycroft *) 27 1.3 jmcneill logger -p warning "${0}: unsupported event ${2} on device ${1}" >&1 28 1.1 mycroft exit 1 29 1.1 mycroft esac 30