Suspend on LID close: Difference between revisions

From Alpine Linux
(Created page with "This article explanis how to make your laptop go to Suspend when closing the LID. This can be done via pm-utils and acpid. Install pm-utils if it is not already. {{cmd|apk ad...")
 
No edit summary
Line 1: Line 1:
This article explanis how to make your laptop go to Suspend when closing the LID.
This article explanis how to make your laptop go to Suspend when closing the LID.


This can be done via pm-utils and acpid. Install pm-utils if it is not already.
This can be done via acpid with a hook in /etc/acpi/LID/00000080:
 
'''a) with pm-utils:'''
{{cmd|apk add pm-utils}}
{{cmd|apk add pm-utils}}
{{cat|/etc/acpi/LID/00000080|#!/bin/sh
exec pm-suspend
}}


Create an acpid hook script called /etc/acpi/LID/00000080:
'''b) with this raw variant:'''
{{cat|/etc/acpi/LID/00000080|#!/bin/sh
{{cat|/etc/acpi/LID/00000080|#!/bin/sh
exec pm-suspend
echo mem > /sys/power/state
}}
}}


Make the hook executable:
Make the hook executable:

Revision as of 02:07, 20 November 2016

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

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

a) with pm-utils:

apk add pm-utils

Contents of /etc/acpi/LID/00000080

#!/bin/sh exec pm-suspend

b) with this 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

And that should be it. Make sure that the acpid daemon is running:

/etc/init.d/acpid start