1

This is my keyboard settings on Kubuntu 20.10:

enter image description here

As you can see, numlock is on when plasma starts up; but it is not working. How can I fix it?

Note: I didn't choose keyboard model; because I don't know it. The chosen model is the default one.

Waiting for your reply, Thank you.

Stockfish
  • 601
  • If numlockx is installed on your system you can add the command of numlockx on to your startup. – Terrance Nov 14 '20 at 15:45
  • I installed numlockx. What's the next step? :) – Stockfish Nov 14 '20 at 16:47
  • Unfortunately I am not using Kubuntu, so I can't write a great answer for you. However, look in the settings for the Plasma desktop and see if there is anything for Startup. If it allows you to add a startup item, all you need is the command of numlockx on added as a startup command named whatever you want. – Terrance Nov 14 '20 at 17:12
  • There are two options in autostart section: 1) Add Program 2) Add Script. If I choose "add program", "numlockx" is not in the list. So I created a .txt file named numlockx.txt with the code "numlockx on" inside it and added the file as a script. But it didn't work. So I created a .sh file named numlockx.sh with the same code. It didn't work either. I'm not sure how to implement that "numlockx on" code as a script file. I'm newbie at these things. – Stockfish Nov 25 '20 at 18:30
  • Either your script needs to be executable (chmod +x numlockx.sh) with a beginning shebang line #!/bin/bash or #!/bin/sh. Or, load it via a command of sh /path/to/numlockx.sh – Terrance Nov 25 '20 at 18:48
  • I did it as you suggested. On login screen the numlock is off; but after I login the numlock starts working and it is on. Can we make it as it starts on login screen? I'm using numbers for login. – Stockfish Nov 25 '20 at 19:18
  • When you create a startup like that it should create a file in your ~/.config/autostart/ folder. If you copy that file to the /etc/xdg/autostart/ folder then it should startup before logging in. You will have to copy with elevated permissions: sudo cp filename.desktop /etc/xdg/autostart/ – Terrance Nov 25 '20 at 22:01
  • Good morning Terrance. Ok, I have both tried Numlockx.sh.desktop and Numlockx.desktop as I wasn't sure if I had to change ".sh" file extension; but coping either file to /etc/xdg/autostart didn't work. Numlock still starts after login. Any suggestions? :/ – Stockfish Nov 26 '20 at 01:45
  • That's all I got as I don't use Plasma / KDE / Kubuntu. Sorry about that. However, take a look at https://docs.kde.org/trunk5/en/kde-workspace/kcontrol/autostart/index.html as it might have clues where to copy the startups to. – Terrance Nov 26 '20 at 02:24

2 Answers2

2

Cant believe I keep google for this each time I reinstall :)

Leaving here the command that I ran in case it might be useful for less experienced users. or for the future myself:

open your terminal and run this (quotes et all):

echo "Numlock=on" | sudo tee -a "/etc/sddm.conf"

  • Finally it works! Thank you very much. However, The main reason I opened the thread was to get past the password screen in no time. Currently numlock is on, but now every time I open Kubuntu I have to click on the password input box with the mouse. Is it possible to enter numbers directly without clicking the box with the mouse? In Windows I log in exactly as I described. – Stockfish Jun 20 '23 at 15:50
  • Are you by chance using ubuntu 23.04 too? Let me summarize what I have found:
    • Trying to press the numbers on the keypad part of the keyboard doesnt write anything into the password box
    • Pressing any a-Z or standar numbers on the keyboard, writes on the password box. Once you do this, its now possible to write using the numeric keypad -You can use alt+numbers on the keypad, and it will also write on the password field by default. This workaround is only needed for the first number.

    I think its related to this bug: https://bugs.launchpad.net/ubuntu/+source/sddm/+bug/2018203

    – Dezemerel Jun 20 '23 at 21:48
0

Create or edit file /etc/sddm.conf and write "Numlock=on" inside.

STAYER
  • 101
  • Hello there! Thank you for your reply. That question was very old, today I have Kubuntu 23.04 (lunar), l’ve tried w/o quotations; none of them works. Any ideas? – Stockfish Jun 01 '23 at 17:37
  • @Stockfish Hello! I spent about one hour to find the answer and only this help with my LTS Kubuntu 22.04. Apparently it is not working in 23.04. I think is may be different display manager. In my 22.04 kubuntu it is SDDM. You can try to dig in that way. May be config in diffrent place, may be 23.04 use another display manager. – STAYER Jun 02 '23 at 18:23
  • When I run: "sudo cat /etc/X11/default-display-manager" the result is: "/usr/bin/sddm". So I'm still using sddm. Should I use quototaion marks or not in sddm.conf file? – Stockfish Jun 03 '23 at 11:18
  • @Stockfish no, you not need quotes. It must be: Numlock=on – STAYER Jun 03 '23 at 18:09