hello icon indicating copy to clipboard operation
hello copied to clipboard

Integrate zzz, xscreensaver and rc.suspend

Open antranigv opened this issue 3 years ago • 9 comments

I just installed helloSystem on a real hardware, finally, so expect a lot of bug reports in the coming days :P

Hardware: Lenovo ThinkPad T480s

I did sudo zzz in the terminal, and it all worked fine. So a proper way to get this integrated is the following.

  1. Add a "suspend/sleep" button in the power options (which, btw, the menu makes no sense, since selecting Shut Down / Restart / Log Out brings the same dialog)
  2. When the hardware is about to suspend, FreeBSD runs /etc/rc.suspend, we can add xscreensaver-command -lock in there, so it locks the screen and sleeps
  3. The hardware is back on! now there's a screensaver, very good security feature!

I can see that hw.acpi.lid_switch_state is set to S3 already, so it will work with the lid as well!

antranigv avatar Jun 07 '21 23:06 antranigv

Add a "suspend/sleep" button in the power options (which, btw, the menu makes no sense, since selecting Shut Down / Restart / Log Out brings the same dialog)

Do we really need this if closing the lid works?

When the hardware is about to suspend, FreeBSD runs /etc/rc.suspend, we can add xscreensaver-command -lock in there, so it locks the screen and sleeps

FreeBSD doesn't do that automatically when hw.acpi.lid_switch_state is set to S3? How can we tell the system to run /etc/rc.suspend when the lid is closed?

probonopd avatar Jun 08 '21 18:06 probonopd

FreeBSD doesn't do that automatically when hw.acpi.lid_switch_state is set to S3?

It does for me.

My computer can suspend perfectly fine, but on FreeBSD and FreeBSD only, when it wakes up, the screen stays off. Switching vt, pushing keys, closing the lid and opening it again, all does nothing. The screen stays black. But printf "\a" makes sound, and sudo reboot restarts the computer.

Another FreeBSD ticket?

kettle-7 avatar Jun 22 '21 06:06 kettle-7

FreeBSD doesn't do that automatically when hw.acpi.lid_switch_state is set to S3?

It does for me.

So, if FreeBSD works as it should. then closing the lid would do the right thing. No need for zzz, correct?

My computer can suspend perfectly fine, but on FreeBSD and FreeBSD only, when it wakes up, the screen stays off.

If you can reproduce this outside of helloSystem (e.g., with "naked" FreeBSD, GhostBSD, NomadBSD, etc.), then I'd kindly ask you to open a ticket with details regarding your hardware (or a ilnk to a Hardware Probe) at https://bugs.freebsd.org/. Thanks!

probonopd avatar Jun 24 '21 17:06 probonopd

My computer can suspend perfectly fine, but on FreeBSD and FreeBSD only, when it wakes up, the screen stays off.

Loading the radeonkms driver did it.

kettle-7 avatar Jun 25 '21 05:06 kettle-7

Okay, how did it take me this long to figure it out?

The radeonkms driver not only lets my computer suspend properly, but also fixes a broken battery status icon in KDE Plasma and lets me change the display brightness!

kettle-7 avatar Jun 25 '21 06:06 kettle-7

Does the radeonkms driver get loaded automatically when you run the helloSystem Live ISO and/or installed system?

probonopd avatar Jun 27 '21 12:06 probonopd

No. I added it to my display manager.

kettle-7 avatar Jun 28 '21 00:06 kettle-7

Do we really need this if closing the lid works?

It will be needed, because the screen of the desktop computer is just collapsed on the table, and there is no function of sleep and lock screen.

louies0623 avatar Dec 10 '22 16:12 louies0623

  • https://github.com/helloSystem/hello/discussions/406#discussioncomment-4371600

louies0623 avatar Dec 11 '22 14:12 louies0623