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
You can just set gnome to remember the Num Lock state between boots:
$ gsettings set org.gnome.desktop.peripherals.keyboard remember-numlock-state true
- 3,922
- 4
- 27
- 45
-
now works for me on kUbuntu 20.04 – SL5net Jan 24 '22 at 18:47
-
Worked for me, Ubuntu 20.04 LTS with Gnome DE (although I'm using i3wm) – Godje Jul 19 '22 at 06:17
Thanks to this video,
I installed numlockx
sudo apt install numlockx
then setup a startrup application with "numlockx on" as the command.
- 151
- 1
- 1
- 5
-
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! – Phantômaxx Mar 31 '21 at 18:39
-
2This 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 Apr 17 '21 at 17:19
No additional package needed, just follow this pathway:
Application Menu > Preferences > LXQt settings > Keyboard and Mouse > Keyboard > Turn on NumLock after login
-
3
-
1I 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. – TheArchitecta May 30 '21 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 Feb 26 '22 at 14:40
From the K-Menu > Settings > System Settings > Input Devices (under Hardware) > Keyboard
The first option is "NumLock on Plasma Startup" just turn it on.
- 21
- 1
-
-
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. – TheArchitecta May 30 '21 at 23:57
-
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
- 21
- 2
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'.)
- 893
- 1
- 9
- 21
-
`gsettings set org.gnome.desktop.peripherals.keyboard remember-numlock-state true`, working for me on Ubuntu 20.04.3 LTS (GNOME 3.36.8) – Broadsworde Sep 10 '21 at 06:31
-
not work of `gsettings set org.gnome.desktop.peripherals.keyboard remember-numlock-state true` here in kUbuntu 20.04 – SL5net Jan 24 '22 at 18:45
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.
- 596
- 3
- 17
-
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"... – Tom Desmond May 18 '20 at 22:21
-
1
-
1Yes 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. – walttheboss May 20 '20 at 06:58
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
- 101
- 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 – TheArchitecta May 30 '21 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 Jun 17 '21 at 08:02
The "NumLock on Plasma Startup"-Option in Kubuntu 20.04 doesn't work.
Just installing numlockx from repository does the job.
- 19
- 1
- 6
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
- 1
- 1