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
- 4,532
Thanks to this video,
I installed numlockx
sudo apt install numlockx
then setup a startrup application with "numlockx on" as the command.
- 161
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
From the K-Menu > Settings > System Settings > Input Devices (under Hardware) > Keyboard
The first option is "NumLock on Plasma Startup" just turn it on.
No additional package needed, just follow this pathway:
Application Menu > Preferences > LXQt settings > Keyboard and Mouse > Keyboard > Turn on NumLock after login
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'.)
- 923
- 2
- 10
- 22
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.
- 646
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
The "NumLock on Plasma Startup"-Option in Kubuntu 20.04 doesn't work.
Just installing numlockx from repository does the job.
- 111
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