Numlock on at gnome startup

I have changed the key values as indicated in the Arch wiki (I can’t post the link because this forum won’t let me):

$ gsettings get org.gnome.desktop.peripherals.keyboard numlock-state                                
true
$ gsettings get org.gnome.desktop.peripherals.keyboard remember-numlock-state            
false

But when I restart numlock it goes back to the off state.
Is it a bug or am I doing something wrong?

none of these two commands set anything
they only get the current value
so: you did not change anything
It does not go back to “off” - it never was “on”.

On my install, numlockx was part of the default installation

I have used get to show the current values of those parameters. If get returns true then it is enabled, isn’t it?

numlockx doesn’t work in my case, I guess because I am in Wayland.

It is indeed - or at least it should be. :man_shrugging:
But the second get command (remember-numlock-state) yields false.
And then you mention:

I’d not expect it to remember the state after a restart if “remember” is turned off.

But that is the full extent of my “knowledge”.


ps and just FYI:

I cannot run the numlock command - only numlockx is available.
No idea what the implications are.

when I run your two commands I get:

gsettings get org.gnome.desktop.peripherals.keyboard numlock-state
false

gsettings get org.gnome.desktop.peripherals.keyboard remember-numlock-state
true

which is the opposite of your settings

I have not changed anything from defaults - and don’t intend to.

Normally you should be able to switch it in the gnome settings or gnome tweaks. There is nothing else you can try, because it tightly integrated on wayland. Sorry, I have no picture, but I remember there was a switch, although In never made use of it.

Well… did you ever set it or only get it?

Are you seriously asking me that question? If I get that org.gnome.desktop.peripherals.keyboard numlock-state is true, it will be because I previously set it, don’t you think?
In the BIOS of my machine I set numlock is on but it seems that Gnome doesn’t give a damn! With KDE this worked well.

I did not touch any of this configuration until I checked that Numlock was not on by default (which is how it should be). So I followed the instructions on the Arch wiki:
gsettings set org.gnome.desktop.peripherals.keyboard numlock-state true

And when I saw that it didn’t work either, I decided to change the second value:
gsettings set org.gnome.desktop.peripherals.keyboard remember-numlock-state false
so that it would not “remember” the state it was in (on and off) and always activate it at the beginning.
But it doesn’t work either.

This here is probably the wiki you mean:

Activating numlock on bootup - ArchWiki

not sure though

Under section 2.4 it lists an alternative:
to add
numlockx on
to some startup script or to ~/.profile

HTH :man_shrugging:

Yes, it is.
numlockx doesn’t work on Wayland.

You didn’t mention wayland before - or I missed it.

The other method you used:
gsettings set org.gnome.desktop ...
is also listed under the section that covers X.org
so I’d assume both methods only apply to X.org

At the end, under section 3 (wayland) is one link pertaining to sway - but I don’t know how one would apply that to Gnome under wayland.
… only my guess :man_shrugging:

and another guess:
X.org it is then, I guess, if you need that functionality
easy fix, too :sunglasses:

Yes, I am asking. I don’t know you and I’ve seen so many bad mistakes here on the forum, so better asking a dumb question than assume the user use it correct. :man_shrugging:

I have never seen that a Desktop on Linux respect Numlock in the BIOS Settings. It must be always set explictily. So it seems KDE does it by default while Gnome not.