i updated my linux to the last version as Linux Mint 18.2 Sarah. after update my numlock is off. i changed mdm to lightdm. this method is not working.
Jaleks' answer was only almost right for me, but this finally worked (Linux Mint 18.2 Cinnamon, manually updated to LightDM (from LM 18.1)):
sudo apt install numlockx, after that, edit
/usr/share/lightdm/lightdm.conf.d/90-slick-greeter.conf file and add the following line at the end:
try to edit
[Seat:*] greeter-setup-script=/usr/bin/numlockx on
Just for reference: weird enough there is a whole ecosystem for numlock settings, depending on which display/window managers one uses, see e.g. the always great Arch wiki: https://wiki.archlinux.org/index.php/Activating_Numlock_on_Bootup
On plain Ubuntu
First install the
$ sudo apt install numlockx
On plain Ubuntu, the LightDM directory in which to create the configuration file is named slightly differently:
$ cd /etc/lightdm/lightdm.conf.d $ sudo touch 00-keyboard.conf $ sudo nano 00-keyboard.conf
The following configuration worked for me:
[SeatDefaults] greeter-setup-script=/usr/bin/numlockx on
In this very configuration file, one can also define the keyboard layout to be used during the LightDM login session.
Mint 18.3 the setup for Numlockx has been added in the "login screen" option (within the "administration" menu)