30 lines
513 B
Bash
Executable File
30 lines
513 B
Bash
Executable File
#!/bin/sh -
|
|
#
|
|
# $NetBSD: lid_switch,v 1.9 2010/12/31 09:33:10 jruoho Exp $
|
|
#
|
|
# Generic script for lid switch events.
|
|
#
|
|
# Arguments passed by powerd(8):
|
|
#
|
|
# device event
|
|
|
|
case "${2}" in
|
|
pressed)
|
|
|
|
# If you want to put the system into sleep when the lid
|
|
# is closed, see the sleep_button -script for examples.
|
|
#
|
|
wsconsctl -d -w backlight=0 >/dev/null
|
|
exit 0
|
|
;;
|
|
|
|
released)
|
|
wsconsctl -d -w backlight=1 >/dev/null
|
|
exit 0
|
|
;;
|
|
|
|
*)
|
|
logger -p warning "${0}: unsupported event ${2} on device ${1}" >&1
|
|
exit 1
|
|
esac
|