Enabling Screen Blanking for the Linux Console
Some quick notes, as I always struggle to find the documentation. I will update this with a full guide shortly.
To enable screen blanking in Fedora, run the following 2 commands. The first enables blanking, with the [0-60] value representing the blanking time in minutes. The second enables power saving mode, again with the time in minutes.
[david@fedora ~]$ sudo setterm --blank [0-60] >> `tty`
[david@fedora ~]$ sudo setterm --powerdown [0-60] >> `tty`
The above commands are run manually after booting a system. To implement it as a post-boot task, a simple systemd unit is required:
/etc/system/systemd/console-blanking.service
[Unit]
Description=Enable virtual console blanking and poweroff
[Service]
Type=oneshot
Environment=TERM=linux
StandardOutput=tty
TTYPath=/dev/console
ExecStart=/usr/bin/setterm --blank 2 --powerdown 5
[Install]
WantedBy=multi-user.target
This works on my Fedora 40 x86_64 systems, but needs further testing across my other hardware & Linux distributions (x86 & AArch64, running a mix of Red Hat Enterprise Linux, Fedora, CentOS Stream, Raspberry-Pi OS, and <shudder> Ubuntu).
grub - more to come.. Notes for now...
consoleblank=300