You are not logged in.

#1 2021-03-06 14:09:16

tea_niugnep
Member
Registered: 2021-02-16
Posts: 30

[Solved]Enable automatic wakeup on lid open without pressing power?

I want to make my laptap (lenovo) able to wake up from suspend state automatically rather than press power button.

I read many pages on Wiki about power management and others, the following is my setting as far, but it doesn't work well:

I use acpid to manage ACPI events, because I need handle ac plug event.
So I set "ignore" value in logind.conf:

HandleSuspendKey=ignore
HandleHibernateKey=ignore
HandleLidSwitch=ignore
HandleLidSwitchExternalPower=ignore
HandleLidSwitchDocked=ignore
HandleRebootKey=ignore

And in my handler.sh:

    button/lid)
        case "$3" in
            close)
                logger 'LID closed'
		systemctl suspend-then-hibernate
                ;;
            open)
                logger 'LID opened'
                ;;
            *)

I'm sure the acpid is working since when lid close my pc suspend. I don't know what command should be used for waking up the suspended laptop.

From my searching, some people adivsed use the

 echo "LID" > /proc/acpi/wakeup

But this doesn't work in my case.
And the content of

 /proc/acpi/wakeup

is:

LID	  S4	*enabled   platform:PNP0C0D:00

In fact, Im not very clear for this. S4 means hibernation, right? But from hibernation to wakeup, I also have to press power button (it's Ok, although), so in here the enabled or disabled value have no difference.

I want to some help. Thanks a lot.

Last edited by tea_niugnep (2021-03-07 03:14:13)

Offline

#2 2021-03-06 15:59:16

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,552

Re: [Solved]Enable automatic wakeup on lid open without pressing power?

S4 implies S3

echo "LID" > /proc/acpi/wakeup

requires root permissions and will toggle the enabled state.
You can eg.

echo "LID" | sudo tee /proc/acpi/wakeup

You don't have to run anything on wakeup and you *cannot* run anything to wake the system; this is done by the BIOS.

For a test: unignore the lid in login.conf, disable acpid, reboot.
Ensure that acpid is not running and the lid is enabled in /proc/acpi/wakeup
Close the lid, the notebook should got to sleep.
Then open the lid, does the system wake up?

If yes, there's perhaps systemd bug (ignoring the lid causing it to falsely disable it on sleep)
If not, the lid simply doesn't wake the system. Check for a BIOS option and BIOS update, if there's a parallel windows, see the 3rd link in my signature and as last straw, you can try to lie to the acpi:
Pass

acpi_osi=! acpi_osi="Windows 2015"

as kernel parameter, https://wiki.archlinux.org/index.php/Kernel_parameters

Then I'm out of ideas :-(

Offline

#3 2021-03-07 03:13:41

tea_niugnep
Member
Registered: 2021-02-16
Posts: 30

Re: [Solved]Enable automatic wakeup on lid open without pressing power?

Thanks.
Although I don't know what happened, after restarting the acpid service and reboot, it can handle lid open event normally

Offline

Board footer

Powered by FluxBB