You are not logged in.
When using
systemctl suspend
the lock-screen gets fullly applied and then system suspends but
systemctl suspend-then-hibernate
is too fast and hyprlock only gets partially applied, rest is applied after system resumes from suspend/hibernate.
I found these two methods from ArchWiki ->
Custom_systemd_-sleep-units
Systemd-sleep-Hooks
All i want is system to wait for few seconds when `suspend-then-hibernate` commands run so that lock-screen gets applied completely. Are there any other way to do this or the above is to be followed?
Last edited by phoenix324 (2024-06-25 13:56:55)
Offline
I've been launching hyrplock independently, and then running the systemctl command (tried with hibernate, but suspend-then-hibernate should work as well) after a short delay:
hyprlock & sleep 0.5; systemctl suspend-then-hibernate
The delay is arbitrary, but if it's too short (say 0.1) you'll probably get the same problem.
Offline
There is a solution here https://github.com/hyprwm/hyprlock/issues/184, basically create a systemd-unit - /etc/systemd/system/root-suspend.service with this contents ->
[Unit]
Description=Local system suspend actions
Before=sleep.target
[Service]
Type=simple
ExecStartPre=-/usr/bin/sleep 1
ExecStart=-/usr/bin/true
[Install]
WantedBy=sleep.target
Adjust the value of delay depending on your system, and then run `sudo systemctl enable --now root-suspend.service`
A more permanent solution would be if hyprlock supported this delay mechanism internally, a way to do this has been discussed, just no one who could/want to implement it.
Last edited by phoenix324 (2024-06-25 13:57:46)
Offline