Re: Disable laptop suspend and hibernate when plugged-in or charging?
On Tue 18 Apr 2023 at 12:57:09 -0400, Jeffrey Walton wrote:
> Hi Everyone,
>
> I have a Pinebook Pro, https://www.pine64.org/pinebook-pro/ . The
> laptop suspends or hibernates even when charging. I cannot SSH into
> it.
>
> I want to disable suspend or hibernate while the laptop is plugged-in.
> I visited https://wiki.debian.org/Suspend , but it does not discuss
> the laptop being plugged into the power cord or charging.
>
> (I make a small distinction between "plugged-in" and "charging." The
> laptop may be fully charged and plugged-in, but it may not be charging
> since it is fully charged).
>
> How do I disable suspend or hibernate when the laptop is plugged into
> the power cord or charging?
I use acpi in another context to do this. The rudimentary script
conatains
STATE=$(acpi | cut -d"," -f1 | cut -d":" -f2 | cut -d" " -f2)
LEVEL=$(acpi | cut -d"," -f2 | cut -d" " -f2 | cut -d"%" -f1)
I haven't thought about the way suspend or hibernate is triggered
from either of $STATE and/or $LEVEL.
--
Brian.
Reply to: