You are not logged in.

#1 2024-10-16 22:58:21

Cylinder3152
Member
Registered: 2024-10-16
Posts: 3

[RESOLVED] Automatically shut down while suspended

Hi,

I've been looking into this and haven't found anything except one question on askubuntu where the answer is specific to the gnome desktop environment.

Basically, I use LUKS encryption on my main drive but usually keep the laptop asleep in my backpack when I'm not using it, to allow me to quickly resume usage. However I don't want to keep the decryption keys in memory all the time, so I try to shut it down when I know it'll be a while until I next use it. However, it would be great to have the laptop automatically shut itself off if it's been in sleep mode for, say, 2 hours without me turning it back on. Same idea as the auto reboot feature on GrapheneOS. Does anyone know if this is possible?

Thanks so much

Last edited by Cylinder3152 (2024-10-17 12:10:17)

Offline

#2 2024-10-17 06:59:18

seth
Member
Registered: 2012-09-03
Posts: 58,659

Re: [RESOLVED] Automatically shut down while suspended

https://wiki.archlinux.org/title/Power_ … _hibernate
"systemctl suspend-then-hibernate", if hibernation is setup and sufficient for your purposes.
The system cannot really do much besides running out of battery while sleeping, but you rtcwake it for 2h and use a resume hook to ckeck how much time it was asleep and if that's more than 119 minutes or so, just shut it down implicitly (maybe launch a timeout for the user to cancel the poweroff within 30s)

Offline

#3 2024-10-17 10:21:28

Cylinder3152
Member
Registered: 2024-10-16
Posts: 3

Re: [RESOLVED] Automatically shut down while suspended

seth wrote:

https://wiki.archlinux.org/title/Power_ … _hibernate
"systemctl suspend-then-hibernate", if hibernation is setup and sufficient for your purposes.
The system cannot really do much besides running out of battery while sleeping, but you rtcwake it for 2h and use a resume hook to ckeck how much time it was asleep and if that's more than 119 minutes or so, just shut it down implicitly (maybe launch a timeout for the user to cancel the poweroff within 30s)

Thank you so much!

Offline

#4 2024-10-17 12:08:17

seth
Member
Registered: 2012-09-03
Posts: 58,659

Re: [RESOLVED] Automatically shut down while suspended

In case and please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.

Offline

#5 2024-10-17 12:10:34

Cylinder3152
Member
Registered: 2024-10-16
Posts: 3

Re: [RESOLVED] Automatically shut down while suspended

seth wrote:

In case and please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.

done - sorry, it's my first time here

Offline

Board footer

Powered by FluxBB