Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add suspend and shutdown options to screensaver #29

Open
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

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

Successfully merging this pull request may close these issues.

3 participants