Ubuntu – How to turn Numlock ON for login screen Ubuntu 17.10 Wayland

17.10gnome-shellnumlockwayland

I know this question comes up a lot, and I've seen some answers.

But the thing is, from what I understand numlockx is made for Xorg and does not work on Wayland.

I saw that some implementations of Wayland like Weston have a config file where I can chose the default behavior for numlock. But I haven't been able to find anything similar for the Gnome Shell implementation on Ubuntu 17.10

Also, I have numlock ON on my UEFI, and it is on during GRUB, but after I start Ubuntu it is switched off.

How can I manage to set this behavior without having to change to Xorg?

Best Answer

You need to set it as gdm user via gsettings command

The solution that should work:

  1. Open terminal via Ctrl+Alt+T, then run command to get root privilege:

    sudo -i

  2. Switch to user gdm in the terminal:

    su gdm -s /bin/bash

  3. Finally set ‘Numlock on’ via gdm user:

    gsettings set org.gnome.settings-daemon.peripherals.keyboard numlock-state 'on'

Restart the computer and done