There already are various methods for automatically enabling NumLock in graphical sessions, but I personally find it handy to also automatically have it enabled in tty
sessions, and maybe you do too. Well, here’s how to do it.
You need a package from the AUR, called systemd-numlockontty
. As most software packages available through the AUR, this package comes as source code only, which will be built into binary code on your local system via makepkg
and a PKGBUILD
script. It doesn’t take very long to build, though.
First, you must fetch and build the package from the AUR, as follows…
pamac build systemd-numlockontty
… or, if you wish, …
yay -S systemd-numlockontty
For those who prefer another AUR helper than yay
, such as trizen
or picaur
, you can of course substitute yay
in the above command by trizen
, picaur
, or whichever other AUR helper you prefer. And if you do use either of those, then you already know this.
Of course, for those of you who are allergic to the command line, you can also fetch, build and install this package via your GUI package manager of choice if it has AUR access enabled. But then again, if you’re really allergic to the command line, then why would you even want to enable NumLock on tty
s in the first place, right?
Anyway, once the package has been built and installed, you can immediately enable it in your running instance and have it run at every next boot all in one go, like so…
sudo systemctl enable --now systemd-numLockOnTty.service
Note: If you have journald
or another system logger directly mirroring its output to tty12
— which should be the default nowadays — then your NumLock will not be enabled on tty12
. There’s no point in that anyway, because tty12
is not an interactive console.