Bug 447461 - Energy settings should provide an option to hibernate after suspend when button pressed or lid closed
Summary: Energy settings should provide an option to hibernate after suspend when butt...
Status: RESOLVED UPSTREAM
Alias: None
Product: Powerdevil
Classification: Plasma
Component: general (show other bugs)
Version: 5.23.3
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-24 10:28 UTC by Peter Ries
Modified: 2022-01-17 16:42 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
energy options with hibernate checkbox - sample (31.34 KB, image/png)
2021-12-24 10:28 UTC, Peter Ries
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Ries 2021-12-24 10:28:30 UTC
Created attachment 144822 [details]
energy options with hibernate checkbox - sample

SUMMARY
***
currently in energy settings there's an option to hibernate after a longer period 9of inactivity on battery and on ac tab. this is only for system suspending after a period of inactivity.
It would be useful to have this option for power button pressed / lid closed, too
***
background: my thinkpad suffers the battery drain bug when in suspend. usually it's running on ac at home and I close lid over night. resume in the morning is fast.
sometimes I work elsewhere on battery. in this case hibernate after suspend would be nice in case I close lid, put the laptop away and don't continue work after an hour or so.

so it would just need two more checkboxes (one on battery tab and on on ac tab) plus lines of code similar to those being used for the suspend after timeout + hibernating.
Comment 1 Nate Graham 2022-01-11 23:52:39 UTC
In all cases, using that setting will make it hibernate after a few hours of being suspended--including when the lid is closed, if the system is configured to suspend on lid close. Does this not meet your needs?
Comment 2 Peter Ries 2022-01-12 17:20:07 UTC
Hi Nate, thanks for picing this up...

My observation was that closing the lid makes the laptop suspend and later hibernate no matter if I'm on AC or battery. As far as I cloud see in sleep.conf there doesn't seem to be a separate option. So I don't know if this is possible at all.

My "wish" would be

on battery: close lid -> suspend and hibernate after x minutes (as configured in sleep.conf?) - save energy
on AC: close lid -> suspend and do NOT enter hibernate state later - wake up much faster

So there would be a "duplication" of this checkbox in the handle button event section on both tabs (AC and battery)

I hope the daemon can handle this at all otherwise it doesn't make sense to extend the energy settings ...

Regards
Peter
Comment 3 Nate Graham 2022-01-13 18:59:29 UTC
Can't you do that already? In the "On AC Power" tab, uncheck the "While asleep, hibernate after a period of inactivity" checkbox. On the "On Battery" and "On Low Battery" tabs, check it.

Does that do what you want? If not, can you describe how what you want is different from what I proposed?
Comment 4 Peter Ries 2022-01-14 07:40:36 UTC
I had it that way. AC unchecked. On Battery checked.

But when I closed the lid while plugged to AC in the evening the laptop woke up from hibernation (long wae up time with decryption password from grub etc...)

So I assumed that the settings are being ignored when id  is closed or button is pressed.

What I didn't test at all is if this happens if I let my laptop suspend after x minutes and hibernate after y minutes of inactivity by itself.

(This would at least tell me if my laptop can stay suspended only or if it ALWAYS hibernates after suspend because of settings in sleep.conf)

I'll analysis when I'm back home. (Currently on holiday with my travel notebook ;) )
Comment 5 Nate Graham 2022-01-14 17:13:42 UTC
Sounds like there is a bug here more so than the lack of a feature or setting. Can you rephrase the title in terms of the bug you're seeing, rather than a request for some feature or fix? Thanks!
Comment 6 Peter Ries 2022-01-17 10:11:53 UTC
Hi Nate, back from holiday I yesterday tried to collect some more information for filing a (new) bug.

But EndeavourOS (Arch based) first gave me half a ton of updates (kernel, systemd, KDE, ...) and magically now it works as desired/expected.

Plasma / systemd sleep now respects my checkboxes and stays in suspend when on AC and hibernates after a while when on battery.

So I'll close this bug.

P.S. really appreciate your work and efforts for Plasma/KDE project and like your pointieststick.com blog :thumbsup:
Comment 7 Nate Graham 2022-01-17 16:42:11 UTC
Great news! Looks like the issue you were facing was upstream of us, probably in upower or the kernel. I guess it got fixed.

Glad you're enjoying the blog!