2

I recently turned on my computer and accidentally left it sitting at the login prompt for hours, needlessly sucking power. A display manager would automatically suspend in that case, but I don't want one.

So can I configure the computer to go to sleep (I guess using systemctl suspend) after idling a few minutes at the login prompt (and ideally also in a logged in tty)?

6
  • How do you know it's not already sleeping and waiting for input to wake it up? Commented Jul 19, 2021 at 2:01
  • because the screen is stil on ^^
    – xeruf
    Commented Jul 20, 2021 at 15:53
  • Okay, the title misled me - I didn't read the second paragraph. See "man systemd-sleep.conf". Commented Jul 22, 2021 at 5:54
  • can you provide a more detailed pointer? I can't find a relevant configuration option there.
    – xeruf
    Commented Mar 3, 2022 at 21:55
  • I don't know what you mean by "login prompt". If you haven't already, shutdown the machine and power it down. Wait a few minuts and power it up. Then wait a while to see if it blanks the scrren. Try wiki.debian.org/Suspend. I use lighDM as a display manager on Debian 10 Buster and I have no problems. But I see a login console after I logout - and my screen blanks after a little while after I stop using it. Also, check your /var/log/{messages,syslog} files. And dmesg. Commented Mar 3, 2022 at 23:27

1 Answer 1

1

I have the same problem, apparently there isn't that much request of non X/Wayland sleep on idle programs, but I found some:

I'm currently using sleepd for my laptop and my desktop.
systemd unit:

[Unit]
Description=auto sleep on idle

[Service]
User=root
ExecStart=sleepd -n -u 600 -U 600 -l 0.5 -w -a -s "systemctl suspend-then-hibernate" -b 10 -d "systemctl hibernate" -a
Restart=always

[Install]
WantedBy=multi-user.target

acknowledgements:

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .