How to deal with "Suspend, then hibernate"
There's this option in per-profile power management settings labeled as "While asleep, hibernate after a period of inactivity". Internally, it's called SuspendThenHibernate
. It's weird and I wonder if we can represent it in a better way. What's wrong with it, you ask?
The scope is misleading
This checkbox is indented to look like a visual part/child of the "Suspend session" checkable section. However, if the "Suspend session" checkbox/section is not enabled, the checkbox for SuspendThenHibernate
is still checkable. Now is this setting only respected for regular auto-suspend, or also when I close my lid or press the power button?
- Answer: It's respected for all top-level sections of a power management profile. Everything that wants to suspend will go through
SuspendSession::triggerImpl()
and there we check for it anytime the daemon wants toSuspendToRam
. - It's not, however, respected for
SuspendHybrid
, i.e. simultaneousSuspendToRam
(i.e. Sleep) andSuspendToDisk
(i.e. Hibernate). Too bad for you, hybrid suspenders. Maybe it would have been nice to turn off the computer after a while if we've already suspended to disk?
The representation is misleading
We have enum entries for SuspendToRam
, SuspendToDisk
and SuspendHybrid
. All of those are represented to the user as distinct options in a drop-down, but SuspendThenHibernate
is somehow a checkbox and a separately stored boolean. And even so, it only affects the behavior of SuspendToRam
. That doesn't sit right with me.
If SuspendHybrid
is "suspend as well as hibernate", then why is SuspendThenHibernate
not also an option in the same drop-down? What's the conceptual difference between both? Why would it not be another value in the same enum that represents all the other power button actions?
Side note: Variable/enum naming is also poor. Hibernate is called SuspendToDisk
elsewhere in the code. Something like SuspendToRamFirstAndDiskLater
would be more consistent than SuspendThenHibernate
.
Some considerations
You might have thoughts on this, such as:
We already have lots of different suspend options in our power action drop-downs. Won't it be super confusing if we add another option?
- Possibly, yeah. If I weren't using KDE, I probably wouldn't even know that there are so many different ways to suspend my system.
- However, it's already confusing, and in ways that doesn't represent the behavior accurately. At least we'd lose the misleading checkbox.
If we make SuspendThenHibernate
another option in the same drop-down, the user will have to select it for each action, instead of just once for the whole power management profile.
- That's true, yeah. It's more manual work in return for a clearer mental model.
- I wonder what use cases there are for selecting different kinds of suspend options for auto-suspend, lid close and explicit power button.
Maybe it should be a global setting?
- No, I don't think so.
- Low battery has a use case for selecting
SuspendToDisk
(orSuspendHybrid
) when other profiles chooseSuspendToRAM
. So whichever way we deal with it within the profile,SuspendThenHibernate
should remain a per-profile setting.
The user will still wonder what the difference is between "Hybrid Suspend" and "Suspend, then Hibernate".
- If we're going to expose these options, we need to add some inline documentation to explain what they actually do. It's not immediately clear how they differ from each other without looking up the Arch Linux wiki.
Proposal
I'm thinking we should revamp both our GUI and our internal variables/config in the following way:
- Remove the confusing checkbox ("While asleep, hibernate after a period of inactivity").
- In all the drop-downs (auto-suspend, lid close, power button), have only a single "Suspend" option instead of three to four.
- That's next to other options such as "Do Nothing", "Lock Screen" and others depending on context.
- On the top-level hierarchy of per-profile power management settings, add a new drop-down to select which kind of suspend action to use.
- Options: "Sleep (Suspend to RAM)", "Hibernate (Suspend to Disk)", "Hybrid (Suspend to both RAM and Disk)", "Sleep, then Hibernate after a period of inactivity".
- All of auto-suspend, lid close, power button will always use the same kind of suspend in this power profile.
- Placing this new drop-down will be easier after the flat-hierarchy redesign that comes with the QML port.
I'm still learning when it comes to UX though. Maybe I'm missing something and there are good reasons to do something else. Discuss!