Suspend on LID close: Difference between revisions

From Alpine Linux
(Cross-reference Busybox acpid page)
m (: Added a name to this section. Faster URL used for the arch wiki hyperlink.)
Line 30: Line 30:
{{cmd|/etc/init.d/acpid start}}
{{cmd|/etc/init.d/acpid start}}


= =
= See Also =
* [https://github.com/jirutka/zzz zzz]
* [https://github.com/jirutka/zzz zzz]
* [https://unix.stackexchange.com/questions/484550/pm-suspend-vs-systemctl-suspend pm-suspend vs systemd...]
* [https://unix.stackexchange.com/questions/484550/pm-suspend-vs-systemctl-suspend pm-suspend vs systemd...]
* [http://archive.md/Bcqlz pm-utils (arch wiki)]
* [https://wiki.archlinux.org/index.php?title=Pm-utils&oldid=498864 pm-utils (arch wiki)]


[[Category:Power Management]]
[[Category:Power Management]]
[[category: Desktop]]
[[category: Desktop]]

Revision as of 20:06, 28 July 2023

This article explains how to make your laptop go to Suspend when closing the LID.

acpid2

acpid2 (provided by package acpid) is a flexible and extensible daemon with Netlink support for delivering ACPI events. The default handler script (/etc/acpi/handler.sh) installed with the package provides support for suspend on LID close out of the box. We recommend installing zzz along with acpid to get support for pre/post suspend hooks etc.

  1. Install acpid and zzz:

    apk add acpid zzz

  2. Enable and start the acpid daemon:

    rc-update add acpid && rc-service acpid start

Busybox acpid

This can be done via Busybox acpid with a hook in /etc/acpi/LID/00000080:

  1. with zzz:

    apk add zzz

    Contents of /etc/acpi/LID/00000080

    #!/bin/sh exec zzz
  2. or with pm-utils:

    apk add pm-utils

    Contents of /etc/acpi/LID/00000080

    #!/bin/sh exec pm-suspend
  3. or with raw variant:

    Contents of /etc/acpi/LID/00000080

    #!/bin/sh echo mem > /sys/power/state

Make the hook executable:

chmod +x /etc/acpi/LID/00000080

That should be it. To make sure that the acpid daemon is running, execute:

/etc/init.d/acpid start

See Also