0

My laptop screen stays on when the lid is closed. How do I enable blanking, and how do I enable display power off after x minutes in the console?

This is a server install on a laptop and I really don't want the screen to be on 24/7 when the lid is closed! Seems wasteful...

setterm --blank 1 --powerdown 2 works, but how do I add this so it survives a reboot?

I followed other questions and a user told me what I had previously done was irrecoverable. I'd prefer to avoid that again? (See: Boot splash persists at login, so powersaving and screen blanking don't come into affect?)

5
  • What happens if you add the command line that works into your bash configuration file ~/.bashrc. That is a way to make commands survive reboot.
    – sudodus
    Apr 24, 2020 at 19:59
  • I'll try that thanks. I previously followed: askubuntu.com/questions/62858/… and made it a service, was that wrong? Apr 24, 2020 at 20:05
  • I don't know how to set up a service, so I don't know if it is right or wrong in this case.
    – sudodus
    Apr 24, 2020 at 20:08
  • isnt there an option in logind.conf HandleLidSwitch= that handles this.
    – user986805
    Apr 25, 2020 at 5:26
  • That defines the action of the lidswitch, I want that set to ignore because I want the lid closed and the laptop to continue working. But I want the inbuilt display to power off (which it doesn't after reboot). Apr 25, 2020 at 7:50

3 Answers 3

1

Since /etc/issue is written to every virtual console, try appending the output of your setterm command:

cp /etc/issue /etc/issue.original
setterm --blank 1 --powerdown 2 >>/etc/issue

I've been using this approach with Ubuntu for a couple months now.

1

The above is great info if you're logged in, but it doesn't resolve my question:

How do I set up the console of the laptop to auto-blank after X minutes. I want to set this natively to the console, not a logged in terminal, because I may not log into it very often, and it may be sitting at a login prompt most of the time.

I would like the console to wake up and display when a key is pressed, and go back to powersave/blank mode after X minutes.

I can't believe it's so hard to find this -- I've been looking for some time. This is something that I got used to on NetBSD and FreeBSD as just a normal configuration parameter for the console. Surely it has to be possible.

1
  • What was your question? This is not an answer to the OPs question, did you err on the page? If you can't answer, please use comments. If you can't comment, wait until you've got enough reputation.
    – kanehekili
    Jun 29, 2020 at 20:35
0

consoleblank= in /etc/default/grub's GRUB_CMDLINE_LINUX_DEFAULT=. https://www.kernel.org/doc/Documentation/admin-guide/kernel-parameters.txt

You must log in to answer this question.

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