After days trying to fix suspend issues in my laptop. I would like to get rid of the Ubuntu suspend system and completely replace it with "S2RAM".
So basically when I press the Power button, the Sleep button, Close the lid: I just want my laptop to call "S2RAM" application, nothing more.
S2RAM is the only thing that works well in my laptop. If I type sudo S2RAM
when I'm playing a video, my laptop goes off in less than 1 second, the Power led and keyboard go off instantly, then I wait some minutes, I press the power button and everything resumes perfectly.
So far I tried this without success:
sudo systemctl edit systemd-suspend.service
And add the following:
[Service]
Type=oneshot
ExecStart=/usr/sbin/s2ram
I also tried the following alternative (changing the path sometimes):
[Service]
ExecStart=
ExecStartPre=-/usr/bin/run-parts -v -a pre /usr/lib/systemd/system-sleep
ExecStart=/usr/sbin/s2ram
ExecStartPost=-/usr/bin/run-parts -v --reverse -a post /usr/sbin/s2ramlib/systemd/system-sleep
Followed by
systemctl daemon-reload
None of these options seem to work. Because if I type systemctl suspend
:
- It is not instant like when running
sudo S2RAM
- Sometimes hangs the system (just like always do)
- Sometimes turns off the screens and doesn't come back
So to me, S2RAM is not taking over at all the Ubuntu "suspend" approach.
Is there any other way to achieve this? I think it will be the only solution to make my Dell laptop sleep in Ubuntu. I tried more than 30 solutions, none worked except S2RAM application. I just need to know how to make it default
systemctl status systemd-suspend.service
please. – nobody Dec 05 '20 at 09:35cat /etc/systemd/sleep.conf
as well assystemctl list-dependencies systemd-suspend.service
PS all s2ram does isecho mem | sudo tee /sys/power/state
(I just checked https://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-utils.git/tree/) ;-) – Dagelf Dec 07 '20 at 21:44