0

I need to enable numlock on the console /dev/tty{1..6} with setleds (numlockx for is dedicated to X11) :

#!/bin/sh -e

# Turn Numlock on for the TTYs:
for tty in /dev/tty[1-6]; do
    /usr/bin/setleds -D +num < $tty
done

But there is no /etc/rc.local file on my system, what is the canonical way to do that ?

SebMa
  • 2,291
  • 2
    (which in turn links to https://askubuntu.com/questions/886620/how-can-i-execute-command-on-startup-rc-local-alternative-on-ubuntu-16-10) – muru Feb 14 '22 at 14:12
  • @muru I want to lock the numeric keypad in the console ttys not in X11/Xorg. The numlockx tool you propose in your first link is for X11 : man numlockx | grep X11 prints numlockx is a program to control the NumLock key inside X11 session scripts. – SebMa Feb 14 '22 at 14:17
  • Good, so you can followe the second paragraph which goes "The problem is, there is no rc.local to start it anymore. You will need to configure systemd to run numlockx once after startup like rc.local would have done. ..." and then links to the second question I commented above. – muru Feb 14 '22 at 14:19
  • @muru Your second link contains the solution in the first answer, that is to sum things up : sudo touch /etc/rc.local, add the commands, and finally sudo chmod +x /etc/rc.local , thanks. – SebMa Feb 14 '22 at 14:27
  • @mchid Yes it does. muru already gave it in his second link. – SebMa Feb 14 '22 at 14:33

0 Answers0