In earlier Ubuntu versions I would do:
sudo apt-get install numlockx
sudo sed -i 's|^exit 0.*$|# Numlock enable\n[ -x /usr/bin/numlockx ] \&\& numlockx on\n\nexit 0|' /etc/rc.local
But starting from version 16.10 there is no file rc.local
, so how to I enable numlock in version 17.04 without desktop environment?
Update: I created rc.local
file as described https://askubuntu.com/a/919598/158442, then executed commands mentioned earlier and now numpad works when I connect over SSH. For it to work in VirtualBox I added these lines to rc.local
:
# Turn Numlock on for the TTYs:
for tty in /dev/tty[1-6]; do
/usr/bin/setleds -D +num < $tty
done
And now everything works!
rc.local
functionality, there were reasons it was removed, I just want to be able to use my numpad :) – Valdas Jul 13 '17 at 08:06rc.local
is run if it exists and is executable, and the defaultrc.local
never did anything, obviously there's no need to keep it in the default. Anybody who wants to use simply needs to create it. – muru Jul 13 '17 at 08:53sudo printf '#!/bin/bash\nexit 0' > /etc/rc.local
I get error Permission denied... – Valdas Jul 13 '17 at 09:58