6

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?

Galvas
  • 71
  • https://askubuntu.com/a/977793/692175 –  Nov 19 '17 at 02:30
  • 1
    That question was also made by me and does not solve the problem. Just made me understand unlockx wont work on Wayland. – Galvas Nov 19 '17 at 02:38
  • The point was to remind you that there's no point in bringing up weston again. I hope you get an answer soon. –  Nov 19 '17 at 02:42

2 Answers2

3

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

1

Don't have the reputation to comment so I have to post this this way.

The @bonhomag 's solution does not work for me. The procedure works with the command

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

instead of the last command in his answer (same command but no '' around the on).

Using Ubuntu 18.04 LTS.

Found that on ArchWiki.

VaNa
  • 303