11

I upgraded to Ubuntu 20.04 Friday and have lost num Lock on boot - how can I set the system so that the keypad Num Lock is set on boot?

10 Answers 10

8

You can just set gnome to remember the Num Lock state between boots:

$ gsettings set org.gnome.desktop.peripherals.keyboard remember-numlock-state true
2
  • now works for me on kUbuntu 20.04
    – SL5net
    Commented Jan 24, 2022 at 18:47
  • Worked for me, Ubuntu 20.04 LTS with Gnome DE (although I'm using i3wm)
    – Godje
    Commented Jul 19, 2022 at 6:17
5

Thanks to this video,

I installed numlockx

sudo apt install numlockx

then setup a startrup application with "numlockx on" as the command.

2
  • It does not work on Ubuntu Studio 20.10. At login, I still have to hit the numlock key, in order to enter my password. Very annoying! Commented Mar 31, 2021 at 18:39
  • 2
    This solution does work for me, but I am still flabbergasted. I set up my BIOS that it turns the numlock on, but during startup Linux turns my numlock off (I believe other distro's have this behaviour as well). To me it sounds like going back 30+ years back in time: download some little tool from a bulletin board system, add it as an extra line to your autoexec.bat to overrule the mistake the OS made, because it is not capable to solve it itself.
    – ffonz
    Commented Apr 17, 2021 at 17:19
3

On Ubuntu 20.04.1

Source French: https://doc.ubuntu-fr.org/numlockx

$ sudo apt-get update

$ sudo apt-get install numlockx

Add this line after install numlockx:

greeter-setup-script=/usr/bin/numlockx

on file "50-slick-greeter.conf"

Path to diretory:

 $ sudo nemo /usr/share/lightdm/lightdm.conf.d/50-slick-greeter.conf


[Seat:*]
greeter-session=slick-greeter
greeter-setup-script=/usr/bin/numlockx on
2

From the K-Menu > Settings > System Settings > Input Devices (under Hardware) > Keyboard

The first option is "NumLock on Plasma Startup" just turn it on.

3
  • Unfortunately, this does not turn the NumLock on before login. Commented Mar 31, 2021 at 18:43
  • This is all I needed: but I could not find it with your instructions. in the start menu finder I search "lx" and went to the "keyboard and mouse" settings, then "keyboard", and tick the same setting "Turn on Numlock after login" So thank you, please add to your answer and I will upvote. Commented May 30, 2021 at 23:57
  • Thanks Mark, that did it for me.
    – user25406
    Commented Feb 2, 2023 at 15:40
2

No additional package needed, just follow this pathway:

Application Menu > Preferences > LXQt settings > Keyboard and Mouse > Keyboard > Turn on NumLock after login
4
  • 3
    Unfortunately, this does not turn the NumLock on before login. Commented Mar 31, 2021 at 18:43
  • 1
    I could not find this, remove the lxqt, and just type in "Keyboard" and the settings will appear. Please adjust your answer and I will up vote. Commented May 30, 2021 at 23:59
  • Thank you, I am using Lubuntu and this helped me. Maybe the other flavors including default Ubuntu also have this setting, as @NZ-Dev suggests.
    – semitones
    Commented Feb 26, 2022 at 14:40
  • Does not work for standard Ubuntu installations.
    – lindhe
    Commented Mar 17 at 17:59
1

This feature is temporarily broken. My preferred workaround uses xdotool (great for desktop automation), install if not already present. Place the following line in a startup script, or can be added to ~/.bashrc if terminal opens on startup:

xdotool key Num_Lock

To make persistent across suspends/hibernates, create (as root) /etc/pm/sleep.d/90_numlock-temp-fix with the following contents:

#!/bin/bash
case "$1" in
  resume|thaw)
    xdotool key Num_Lock
  ;;
esac

Backstory: The following two keys should work to both set numlock on and make that the default bootup state.

  • org.gnome.desktop.peripherals.keyboard numlock-state true
  • org.gnome.desktop.peripherals.keyboard remember-numlock-state true

In 20.04.1, at least so far, they are ignored.

Unused keys are typically a tipoff that the object controls are in a state of flux. There are several dealing with numlock so expect this to be fixed, hopefully in the next minor release (which should be out any time now?).

If these two keys are already set, watch for the bootup numlock state to return to 'off', which means the bug is fixed and this workaround can be removed. (Numlock will then boot 'on'.)

2
  • gsettings set org.gnome.desktop.peripherals.keyboard remember-numlock-state true, working for me on Ubuntu 20.04.3 LTS (GNOME 3.36.8) Commented Sep 10, 2021 at 6:31
  • not work of gsettings set org.gnome.desktop.peripherals.keyboard remember-numlock-state true here in kUbuntu 20.04
    – SL5net
    Commented Jan 24, 2022 at 18:45
0

Num-Lock can be set on the Input devices page in settings. BUT some computers set this in Bios. Boot to the Bios and look for it there as well.

3
  • I don't see "inout devices" in "settings" - I see Keyboard Shortvuts" and "Mouse & touchpad" but can't find any num Lock option and searching settings does not find any match on "num"... Commented May 18, 2020 at 22:21
  • 1
    It's not in the BOIS... Commented May 18, 2020 at 23:01
  • 1
    Yes Good call. I have search all over and the setting is simply not there. It was in earlier versions of Ubuntu. I am a Kubuntu guy. I have searched the web all over. I am blown away why something like that is not in settings. Commented May 20, 2020 at 6:58
0

Addition answer @Daniel Pablo Sheng: In Xubuntu 20.04 for me work this:

$ sudo gedit /usr/share/lightdm/lightdm.conf.d/50-xubuntu-numlock.conf

[Seat:*]
#greeter-setup-script=xubuntu-numlockx
greeter-setup-script=/usr/bin/numlockx on

reboot

2
  • Can you please confirm whether anything else needs to be done: for example lightdm in my machine does not exist in the share directory. also numlockx would need to be installed right. could you update your answer to provide more clarity Commented May 30, 2021 at 23:53
  • You can try using the /etc/lightdm/lightdm.conf.d directory and create or edit files there. It all depends on the desktop environment you are using.
    – Alex_Krug
    Commented Jun 17, 2021 at 8:02
0

The "NumLock on Plasma Startup"-Option in Kubuntu 20.04 doesn't work.

Just installing numlockx from repository does the job.

0
0

This worked for me in MX-Linux 21.3 (Debian 11) with KDE-Plasma 5:111.

edit this file: /etc/sddm.conf.d/kde_settings.conf

under "[general]" add this:

Numlock=on

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .