You are not logged in.
For the life of me I can't figure this out...
I just installed archlinux on an ancient laptop (thinkpad t420).
How do I run setterm --blank=1 just before the login? I'm not using X or Wayland... just a standard console login.
I want it to run once after a reboot, and before anyone actually logs in -- it's a laptop that's basically a headless server.
Pretty sure the kernel used to do this back in the day automatically...
I tried writing a service unit to run a script that runs the command, but it doesn't work and systemctl reports it as failed for some reason. I tried a bunch of variations (oneshots, setting restarts, running a script that runs setterm, delaying the script until after networking...) for the .service, but here's the simplest one:
[Unit]
Description=My Power Management
[Service]
ExecStart=/usr/bin/setterm --blank=1
CPUSchedulingPolicy=idle
[Install]
WantedBy=multi-user.targetIt even doesn't actually work even if I try to start the service after logging in as root (although it seemingly starts then without error, at least none immediately reported). It seemingly does nothing. But if I just type out the command, it works fine.
Last edited by Daemonjax (2022-04-23 14:49:23)
Offline
Please anyone correct me if I'm wrong - I would suggest putting a script in '/etc/profile.d/' without '#!/bin/shellofyourchoice'.
Last edited by dogknowsnx (2022-04-23 14:51:11)
Please anyone correct me if I'm wrong - I would suggest putting a script in '/etc/profile.d/' without '#!/bin/shellofyourchoice'.
All scripts there run after login.
Offline
dogknowsnx wrote:Please anyone correct me if I'm wrong - I would suggest putting a script in '/etc/profile.d/' without '#!/bin/shellofyourchoice'.
All scripts there run after login.
True. How about setting the
consoleblank=1kernel parameter?
Last edited by dogknowsnx (2022-04-23 15:20:41)
consoleblank=1kernel parameter?
That worked! Nice. It's in seconds there, so consoleblank=60 should do it.
Offline