Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

Add suspend and shutdown options to screensaver #29

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wbrawner
Copy link

@wbrawner wbrawner commented Sep 3, 2024

This adds SUSPEND and SHUTDOWN as options to the screensaver. I put the options under screensaver to avoid confusion about the timeouts (e.g. if you have the device set to shutdown after 2m but screensaver after 5m, should the timeout for shutdown occur before the screensaver or does the shutdown timeout wait until the screensaver has started?). I've attached screenshots for reference as well, taken from my RGB30.

rocknix-suspend

rocknix-shutdown

Of note is that the behavior only affects emulationstation, so the device still won't suspend or sleep while a game is open. I have a WIP branch1 where I've added swayidle as a package to attempt to get the device to suspend mid-game after some inactivity, but it seems that XWayland and/or the emulators don't properly support idle-inhibit2, so in my testing my device would just suspend or shutdown in the middle of gameplay despite actively playing.

Footnotes

  1. https://github.com/wbrawner/distribution/tree/idle-suspend

  2. https://github.com/swaywm/swayidle/issues/5

@aenertia
Copy link

aenertia commented Sep 3, 2024

Do you know if you can use hyrbid suspend (i.e suspend to disk after X time/dischage) along with a resume partition to achieve this. IIRC this would require an additional kernel module and a dedicated swap partition. https://linux.die.net/man/8/pm-suspend-hybrid

@wbrawner
Copy link
Author

wbrawner commented Sep 3, 2024

I think we would need the swap partition, not sure about the kernel module though. I think systemd would handle this now though, with systemctl suspend-then-hibernate

@aenertia
Copy link

aenertia commented Sep 3, 2024

You can actually use an offset location and a swap-file rather than dedicated partition, although dedicated partitions tend to be easier to deal with as you don't need to get the block offset added to the kernel cmd

@wbrawner
Copy link
Author

wbrawner commented Sep 4, 2024

Yeah I saw that too, wasn't even going to suggest it though since I figured the partition would just be easier

@porschemad911
Copy link
Collaborator

porschemad911 commented Sep 4, 2024

Yes, would just need to size the partition correctly based on device RAM.

@aenertia
Copy link

aenertia commented Sep 5, 2024 via email

@wbrawner
Copy link
Author

wbrawner commented Oct 5, 2024

Fair enough! Sorry for the delay, I was out of my home country for a couple of weeks so I didn't have access to my home computer. I'll take a look at getting a swapfile created and test hibernation out on my device

@wbrawner wbrawner marked this pull request as draft October 5, 2024 02:06
@aenertia
Copy link

aenertia commented Oct 6, 2024 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants