Artix Linux Forum

Init systems => dinit => Topic started by: riri on 05 September 2022, 19:28:00

Title: [SOLVED] suspend with dinit
Post by: riri on 05 September 2022, 19:28:00
long usage of systemd made me dumb, and I have no idea how to put the computer on S3 state from a command/script.

dinit does the halt/reboot things, but not suspend. I read that state can directly be set by echoing in sys:

Code: [Select]
echo "mem" > /sys/power/state

But that can put the graphic card (nvidia with nvidia driver... yes I know, or vmware in a virtualbox) in a weird state, so the resume does not work correctly.

Some of you have hints?
Title: Re: suspend with dinit
Post by: capezotte on 06 September 2022, 15:04:46
As in all of Artix's inits, the recommeded way to suspend is loginctl suspend. loginctl also allows powering off and rebooting without sudo.

It's not like echo mem > /sys/power/state doesn't suspend, but it doesn't run any sleep hooks/scripts, one of which is required by the nvidia driver (https://gitea.artixlinux.org/packagesN/nvidia-utils/src/commit/65c3205e9ef88fcc090fab5621e236935e451101/trunk/PKGBUILD#L219).