landry added the sensor back in 2013 and suspend via sleep button also works
(at least on ThinkPads).

machdep.*action are super useful and I dislike grepping /etc/examples/
for to read about them.

acpibtn(4) is the most prominent driver supporting, so documenting them
there seems fine and finally pleases my muscle memory:

        $ man -k any=lidaction
        acpibtn(4) - ACPI button

suspend/hibernate wording is taken from apm(8).
sysctl value list style is taken from sysctl(2)'s KERN_POOL_DEBUG.

Feedback? OK?

Index: acpibtn.4
===================================================================
RCS file: /cvs/src/share/man/man4/acpibtn.4,v
retrieving revision 1.5
diff -u -p -r1.5 acpibtn.4
--- acpibtn.4   16 Jul 2013 16:05:48 -0000      1.5
+++ acpibtn.4   31 Aug 2021 23:37:20 -0000
@@ -25,17 +25,59 @@
 .Sh DESCRIPTION
 The
 .Nm
-driver is used to handle the event triggered when the user presses an ACPI
-button.
-Currently, the only event handled is the press of a power button which
-causes the system to perform a regular system shutdown and power off the
-machine if the
+driver handles events triggered by ACPI buttons.
+Currently, only power button, sleep button and lid status events are supported.
+.Pp
+The power button event is handled according to the
+.Va machdep.pwraction
+.Xr sysctl 8 .
+Valid values are:
+.Pp
+.Bl -tag -width 3n -offset indent -compact
+.It 0
+Do nothing.
+.It 1
+Perform a regular system shutdown and power off the machine if the
 .Va hw.allowpowerdown
+sysctl is set to 1.
+.It 2
+Put the system into suspend (deep sleep) state.
+.El
+.Pp
+The sleep button event puts the system into suspend (deep sleep) state.
+.Pp
+The lid status event is handled according to the
+.Va machdep.lidaction
+sysctl.
+Valid values are:
+.Pp
+.Bl -tag -width 3n -offset indent -compact
+.It 0
+Do nothing.
+.It 1
+Put the system into suspend (deep sleep) state.
+.It 2
+Put the system into hibernation.
+System memory is saved to disk (swap space)
+and the machine is powered down.
+For machines supporting the
+.Xr acpi 4
+style hibernate functionality, on resume a full kernel
+boot will occur, followed by the reading of the saved
+memory image.
+The image will then be unpacked and the system resumed
+at the point immediately after the hibernation request.
+.El
+.Pp
+The lid status is set up as sensor and can be monitored using
 .Xr sysctl 8
-is set to 1.
+or
+.Xr sensorsd 8 .
 .Sh SEE ALSO
 .Xr acpi 4 ,
-.Xr intro 4
+.Xr intro 4 ,
+.Xr sensorsd 8 ,
+.Xr sysctl 8
 .Sh HISTORY
 The
 .Nm

Reply via email to