Numlock is forced on at session login in 24.04

Hi. I have just installed Ubuntu Budgie 24.04 and for some reason it forces NumLock On each time I login in the session. I already configured numlock off at the login window configuration, so at the login screen numlock is off, but as soon as I enter the session it gets on. This is really annoying. Is there anyway to fix it?

Hi @fvroig!

Basically, the system remembers keypad last state. So If it was active when you switched off your computer, numlock will still be on when you switch back on, too.

But you can easily change this behavior by entering this line in the terminal:

gsettings set org.gnome.desktop.peripherals.keyboard numlock-state 'false'

:upside_down_face:

Thanks @jlb
However, it did not solve the problem.

  1. Even if the numlock is off when I logoff the session, it turns to on when I login again. And the same happens when rebooting the system, i.e. the numlock is off before reboot and turns to on when I login in the session after reboot. So, the system is not remembering the last state of the keyboard.

  2. The Gnome shell property org.gnome.desktop.peripherals.keyboard numlock-state is already set to its default value, which is false. I checked it using the Dconf Editor. Nevertheless, I executed the command to fix it, as you suggested, but it did not solve the problem either.

In the end, the solution I found, which is far from satisfactory, was to manually turn off numlock through the command

numlockx off

and include it as a startup app. But the mystery of why numlock is forced to on at login still remains.

Sorry, I got confused, I wanted to say “remember-numlock-state”:

gsettings set org.gnome.desktop.peripherals.keyboard remember-numlock-state 'false'

With this setting and “numlock-state” on default value (false), you should get what you want.

:confused:

Thanks again @jlb but unfortunately this additional configuration didn’t solve the problem.

Curiously, the problem also occurs when running from the Live ISO. In other words, I boot from the Live ISO with the numlock off, and as soon as I am logged in the session, the numlock is turned on.

I will check in a different computer.

Strange indeed: I can confirm that this works on my Acer Aspire AV15-51, even in live session. :thinking:

In live session, both “numlock-state” and “remember-numlock-state” are natively set to their default values, respectively “false” and “true”:

Setting “remember-numlock-state” to “false” allows you to start up with numpad disabled:

And without adding numlockx off at startup.

Well, maybe is something specific of my notebook model (Sony Vaio). Since the numlockx off is doing the job, I will not spend more time in this. Many thanks @jlb

Thanks @fvroig!

From what I’ve read, the way it works may depend on the computer model. Is there a parameter in your BIOS?

Even if your workaround does the job, you could also try setting numlocckx to “off” in its “/etc/default/numlockx” configuration file before moving on (default value seems to be “auto”):

# Configuration file for numlockx

# State of numlog on start of X session
# Accepts following options:
#  auto - turns numlock on unless ran on laptop
#  on - turns numlock on
#  off - turns numlock off
#  keep - does not change numlock state
#  toggle - toggles numlock state
NUMLOCK=off

That’s it!!! That solves the problem. Unbelievable…
The default value was indeed auto, so I presume that numlockx erroneously interprets that my laptop is a desktop, and this should be something related to my specific model.
BTW, there is no possibility to configure numlock state in the BIOS.
Many thanks!

Hi from France. Thank you for this solution ! the automatic keyboard lock is also a problem on Mac computers with keyboards without numeric keypads. problem fixed with this solution :wink:

Merci, @Doune!
Décidément, ce forum devient un repaire de froggies ! :joy:

je suis la seule ritale active? :sob:

No, Silvia, no, c’è anche almeno @ilvipero ! :sweat_smile:

j’ai dit seule, donc oui :rofl:

Brava, Schtroumpfette ! :flushed_face: