Enable Boot Up NumLock On Fedora 43 / GNOME 49 / HP Omen 15

I’ve recently jumped ship from Windows, and it hasn’t disappointed me in any way!

There was a very minor inconvenience that was driving me nuts - “Boot up NUM LOCK!!” Hahah…

After searching around, I’ve found this solution to work, and I thought I’d share it here with the community:

::Create a Service to handle Numlock::

sudo nano /etc/systemd/system/numlock.service

::Add these to the file::

[Unit]
Description=Enable NumLock at boot
After=graphical.target

[Service]
Type=simple
ExecStart=/usr/bin/numlockx on
Restart=on-failure

[Install]
WantedBy=graphical.target

::Reload the config & Enable the service::

sudo systemctl daemon-reload
sudo systemctl enable numlock.service

::Reboot ::

sudo reboot

Best of luck !!

::::EDIT::::slight_smile:

My setup is - Fedora 43 / GNOME 49.2 / HP Omen 15 i7 7700HQ

And before this, I tried installing all these solutions but none of them worked for me!! But listing them here just in case anyone else wants to try:

:: “numlockx” & “numlockw”

:: Gnome Tweaks > Keyboard > Additional Layout Options > Compatibility Options > Numeric keypad always enters digits

Must be a Gnome “design” decision. On KDE it’s in settings, where you’d expect to find it.

1 Like

I don’t expect this would work on Wayland, that is Gnome and KDE among others. In general, each Display Manager and each Desktop Environment each has specific ways to setting the numlock. For the Virtual Terminals (alt-shift-F3) you use the setleds command to control this.

1 Like

It works on my setup :slight_smile:

Fedora 43 Workstation (GNOME, Wayland)

Bizarre - I have no numlockx installed on my system at all, anywhere. Which package have you installed which provides that binary?

┌─🎩 lurcher ~
├─
└─➜ ls -al /usr/bin/num*                                                                                                                              16:21 Fri 05-Dec
Permissions Size User Date Modified Name
.rwxr-xr-x@  53k root 24 Jul 00:00  /usr/bin/numad
.rwxr-xr-x@  62k root 29 Sep 00:00  /usr/bin/numfmt

I just did a dnf list installed numlockx and it shows an available package…

1 Like
┌─🎩 lurcher ~
├─
└─➜ dnf list --installed numlockx                                                                                                                     16:22 Fri 05-Dec
No matching packages to list

As I don’t have the binary installed, it won’t show me what package provided it. I’d have to use dnf provides numlockx which obviously I can do, but as that package is apparently not installed by default on KDE, I was wondering what the OP installed to get it, given that he does not list his Desktop environment.

Makes no odds to be totally honest - I have it easily adjustable in settings without the effort of having to write a systemd job just to toggle numlock on.

To install numlockx run sudo install numlockx.

However, you can install dconf-editor and then run it. Then navigate to

 org / gnome / desktop / peripherals / keyboard

and set the numlock status.

The dconf-editor seems not to be included in Gnome, so you need to install it yourself if you want it. The same goes for numlockx.

There is supposedly a program named numlockw which should work on Wayland. This program is not provided by the Fedora project.

Don’t need it - it’s baked into KDE settings out of the box. I’m somewhat surprised that Gnome doesn’t have something just as easily adjustable out of the box too.

Saying that, I’m often surprised by Gnome design choices.

yes but it’s OFF by default (((
and setup does not even ask whether to enable it permanently…

I’m wondering why it’s always off and one has to enable it manually…
I guess in today’s world if a keyboard has the numpad - the caps lock should be on by default as the vast majority of users use it for entering numeric data, not for navigation.

Mine defaults to “Leave untouched” in KDE settings and my BIOS sets it to On.

Regardless, going into KDE settings, finding keyboard and adjusting to suit as you desire seems to be lass of a faff than installing numlockx and writing a system script to flip it.

Even if I wanted to do this, slapping it into the bash/fish/ksh/zsh/profile/whatever.rc file seems to be less fiddling than arsing around with systemd.

Each to their own though - I use a keyboard without a numlock at all, so it’s utterly moot.

2 Likes

You savage! :slight_smile:

1 Like

The problem started by the very first IBM PC which provided a keyboard without any cursor keys. It did have a numeric pad that could also be used as cursor keys. That linux never took the numlock setting from the BIOS settings is also quite strange. If MS-WIndows can do it, it should be possible for Linux to do that as well.

Just an FYI… No idea why I typed in what I typed in earlier. But I went back and edited it. The command that I used had no “-” in it. And even though I don’t have that package installed it did show that it was available…

dnf list installed numlockx
Updating and loading repositories:
Repositories loaded.
Available packages
numlockx.x86_64 1.2-29.fc43 fedora

LOL. Apparently the word installed was doing nothing. Could have just used dnf list numlockx.

I apologize, of course i meant Num lock :sweat_smile:

2 Likes

Appearently, the word “installed” means the package named “installed”.

No, because the package that I was looking for was not installed at all. It was only available. It is listed under “Available packages”… Or maybe you are saying that my command meant that it should look for two separate packages, one name “installed” and one named “numlockx”. In that case you would be correct. Anyway I messed up but got useful information anyway.

Strange that it didn’t throw up an error message for my bungling.

My point is that I should have used the command dnf list --installed numlockx. But by bungling it I actually got information that the package was available.

Exactly that.