You are not logged in.

#1 2019-10-08 12:37:02

charlie
Member
Registered: 2013-09-18
Posts: 57

numlock deactivated at each start and after sleep mode

I am trying to keep numlock on by default (this is how the keyboad is usually set up in my language).

I have followed instructions from the wiki (https://wiki.archlinux.org/index.php/Ac … _on_Bootup) but to no avail. I have run the numlockx on the command line directly and realised that it does not do anything, neither "numlockx on" nor "numlockx toggle" change the state of the numlock.

Toggling numlock with the button directly still work, but strangely the state is systematically disabled every time the lap top is put on sleep mode and waken up again.

Any idea of what I could do?

Offline

#2 2019-10-08 13:12:55

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,958

Re: numlock deactivated at each start and after sleep mode

About numlockx being inoperative: is this actually an X11 session (or maybe wayland or "just" a console?)
The state changes w/ the sleep because the keyboard technically gets removed and re-added - you could add a sleep hook once you figured how to alter the setting in software.

Offline

#3 2019-10-08 13:28:07

charlie
Member
Registered: 2013-09-18
Posts: 57

Re: numlock deactivated at each start and after sleep mode

It is gnome terminal, session type is wayland.

Offline

#4 2019-10-08 13:33:17

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,958

Re: numlock deactivated at each start and after sleep mode

numlockx won't do anything on wayland, so forget about that.
Try

gsettings set org.gnome.settings-daemon.peripherals.keyboard numlock-state on

(I just googled that up, not using gnome)

Offline

#5 2019-10-08 13:56:07

charlie
Member
Registered: 2013-09-18
Posts: 57

Re: numlock deactivated at each start and after sleep mode

Thank you for looking this up but I've found this as well. There are other suggested command but none seem to work.

For example (https://askubuntu.com/questions/977903/ … 10-wayland):

$ gsettings set org.gnome.settings-daemon.peripherals.keyboard numlock-state on
No such key “numlock-state”

and (https://unix.stackexchange.com/question … n-in-gnome)

$ gsettings set org.gnome.settings-daemon.peripherals.keyboard remember-numlock-state true
No such key “remember-numlock-state”

Is there a way to know which gsetting to set?

Last edited by charlie (2019-10-08 13:57:54)

Offline

#6 2019-10-08 14:11:47

glitsj16
Member
Registered: 2015-04-26
Posts: 126

Re: numlock deactivated at each start and after sleep mode

Those keys have been dropped, the wiki page needs some updating for Gnome 3-34. You can use gnome-tweaks  > Keyboard & Mouse > Additional Layout Options > Miscellaneous compatibility options. That has a few numeric keypad settings you can activate. The sleep/resume issue is a mutter bug and has been fixed upstream. Next mutter upgrade should have that. Or you can use mutter-performance from AUR and build from git master.

Offline

#7 2019-10-08 14:19:10

charlie
Member
Registered: 2013-09-18
Posts: 57

Re: numlock deactivated at each start and after sleep mode

Thanks. I'll check as soon as mutter is updated. May I ask how did you know where to find these options?

I don't think this is solving the problem, I still need to have num lock on at start up, but not sure which option will do the job. Setting the option to set the "windows" behavior didn't set the numlock at startup.

Last edited by charlie (2019-10-08 14:47:10)

Offline

#8 2019-10-08 15:13:57

glitsj16
Member
Registered: 2015-04-26
Posts: 126

Re: numlock deactivated at each start and after sleep mode

I have only 2 options enabled from that section: 'Default numeric keypad keys' and 'Numeric keypad always enters digits (as in macOS)'. That works for me.

Offline

#9 2019-10-08 15:52:06

charlie
Member
Registered: 2013-09-18
Posts: 57

Re: numlock deactivated at each start and after sleep mode

I have tried combinations of options. Turns out that the "Numeric keypad always enters digits (as in macOS)" sets the numlock, but permanently (but that's no big deal) in particular at startup (since there is no other option).

I don't know what the option "Default numeric keypad keys", but it's neither necessary nor sufficient to have this for numlock on startup.

The login screen still doesn't have numlock on (but ok, i don't really need it there).

The terminals have the numlock on.

Basically there is still an issue with the ability of having numlock by default, except for the terminals which seem to do just fine. But at least it's possible to have numlock by default by simply setting an options that remove the "numlock" process entirely.

Last edited by charlie (2019-10-08 15:53:06)

Offline

#10 2019-10-08 22:08:39

glitsj16
Member
Registered: 2015-04-26
Posts: 126

Re: numlock deactivated at each start and after sleep mode

The login screen runs as user gdm. Basically you'll need to replicate keyboard settings for that user to have numlock on at the login screen. See the GDM wiki page for more info on that. In the mean time I've found the relevant dconf key: org.gnome.desktop.input-sources xkb-options. Once you have numlock on at the login screen it should keep state once you're logged in:

$ gsettings set org.gnome.desktop.input-sources xkb-options "['numpad:mac']"
$ sudo -u gdm dbus-launch gsettings set org.gnome.desktop.input-sources xkb-options "['numpad:mac']"

Using that key you can make a small toggle script and bind it to a shortcut of your choice. To disable numlock you'll need to empty out the key like this:

$ gsettings set org.gnome.desktop.input-sources xkb-options "['']"
$ sudo -u gdm dbus-launch gsettings set org.gnome.desktop.input-sources xkb-options "['']"

Offline

#11 2019-10-09 08:28:50

charlie
Member
Registered: 2013-09-18
Posts: 57

Re: numlock deactivated at each start and after sleep mode

Thanks. I wish there was an option to remember the state of the numlock.

Offline

#12 2019-10-09 09:34:46

bulletmark
Member
From: Brisbane, Australia
Registered: 2013-10-22
Posts: 713

Re: numlock deactivated at each start and after sleep mode

@glitsj16, thanks for showing us the "Numeric keypad always enters digits" tweak option. IMHO, that is superior to bothering about the state of numlock given I only ever want numeric keys.

Offline

#13 2019-10-09 10:24:07

charlie
Member
Registered: 2013-09-18
Posts: 57

Re: numlock deactivated at each start and after sleep mode

I think one of the issue with only having numeric keys is for some laptops with small keyboard. As a matter of fact I would only use numeric keys as well but I reckon that people might need this. Also the way the keypad is used probably depends a lot on the language the keyboard is in. I don't  know specific example but I can imagine that could be an issue as well.

Anyways, I'm looking forward to the mutter update see how this goes.

Offline

Board footer

Powered by FluxBB