Uncategorized

How To Turn On Num Lock Automatically On Startup In Linux

turn on num lock in linux

One of the frustrating thing in most Linux distros is that the Num Lock is not enabled on startup. Whenever I start typing my password at system login screen, the focus goes out of the password field. It happens very often with people and this little problem is very irritating. But don’t worry. You can set your Linux to enable Num Lock automatically on startup.

How To Turn On Num Lock Automatically On Startup In Linux?

This little but irritating issue has been recently fixed in Linux Lite 3.0. Perhaps, they also realised how irritating it is to keep the Num Lock turn off on startup. Well, if you’re using any other distro such as Ubuntu or derivative then this article will fix the issue.

Install ‘numlockx’

We have a tiny tool available in the default Ubuntu repostiory that will help us out turning on Num Lock automatically on startup. I’ve not tested it in other than Ubuntu so I’m not sure at the moment the trick will work or not. I’ll soon test and will update the article.
sudo apt-get -y install numlockx
turn on num lock at startup in linux

  • Now paste the following script in the terminal. You’ll further see gedit window.
sudo gedit /usr/share/lightdm/lightdm.conf.d/50-unity-greeter.conf
num lock in linux numlockx

Now paste the following line in the configuration file and hit ctrl + s or save. Now exit the window. And that’s all.You’ve now configured the system to enable Num Lock automatically on startup. No more irritation. 🙂 As I mentioned I have only tested it working on Ubuntu though it should work on the other distros but I can only be sure after testing it myself.

Do let me know in the comments if it worked for you with other distros or not. If you have any problem then comment below the post in comment section, I’ll help you out.

Also share this article with your friends on social pages. Thank you!

Our sponsor - Deploy your server within 3 minutes


6 comments

Saulius October 6, 2019 at 9:50 pm

Didn’t work on Debian 10

Reply
Jim November 11, 2019 at 5:32 am

I was unable to get this to work in Ubuntu 18.04.3 lts. I’m new at this and perhaps I was unable to correctly enter the text into gedit:

[Seat:*]
greeter-session=unity-greeter
greeter-setup-script=/usr/bin/numlockx on

What I get in Terminal:

** (gedit:2305): WARNING **: 17:45:44.000: Set document metadata failed: Setting attribute metadata::gedit-spell-language not supported

Yes, gedit is installed

Reply
Craig December 27, 2019 at 6:26 am

Worked perfect in Linux Mint 19.3 using nano instead. Thankyou

Reply
Jesse January 3, 2020 at 9:59 pm

I have Kubuntu 18.04.3 LTS which is a close relative of Ubuntu. Numlockx is not needed with the sddm in Kubuntu. There is a file sddm.conf in /usr/share/doc/sddm/. There’s different “stuff” in there, but for numlock look at the [General] section of sddm.conf.

Copy the general section and past to a new document. Uncomment the Numlock line and change “auto” to “on” (no quotes) then save as /etc/sddm.conf using admin privileges. I used Kate as the text editor as it prompts for the sudo password.

When you shutdown and boot again numlock should be on for password entry at the login screen. Your General section in the saved /etc/sddm.conf should like below. [If you already have an /etc/sddm.conf file just edit the General section for Numlock=on]

[General]
# Halt command
HaltCommand=/bin/systemctl poweroff
# Input method module
InputMethod=qtvirtualkeyboard
# Initial NumLock state. Can be on, off or none.
# If property is set to none, numlock won’t be changed
# NOTE: Currently ignored if autologin is enabled.
# Numlock=none
Numlock=on
# Reboot command
RebootCommand=/bin/systemctl reboot

Reply
Charlie January 12, 2020 at 9:18 pm

Did not work on Ubuntu 19.10

Numlockx installs without error. The 50-unity-greeter.conf is created and the text inserted.

On boot, numlock is off.

Reply
Brad Hedges January 20, 2020 at 1:07 am

Worked fine on new Raspbian Buster install on R Pi 4 (replacing gedit w/ mousepad in the command; did not use the [Seat]… whatever line…

Thanks!

Reply

Leave a Comment

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More