On Thu, May 31, 2012 at 7:37 AM, Jan Stary <h...@stare.cz> wrote: > On May 30 20:15:42, Robert Connolly wrote: >> Hello. >> >> Is there any way to configure an ACPI event, such as closing the lid of a >> laptop, to run a script, like 'apm -C' and screensaver? >> apm(8) and sensorsd(8) don't seem to do anything like this. > > Not exactly hooked to a lid close but to a suspend > (which happens on lid close if machdep.lidsuspend=1) > - see apm(8) mentioning /etc/apm/suspend.
I have this in my ~/.xinitrc: xidle -area 1 -delay 10800 -program "/usr/X11R6/bin/xlock -mode blank" & And then in /etc/apm/suspend: ---8<--- #!/bin/sh pkill -30 -x xidle ---8<--- Cheers! David