LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-26-2020, 08:14 PM   #1
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,982

Rep: Reputation: 271Reputation: 271Reputation: 271
What makes numlock the default?


My computer, an old Toshiba Satellite, starts with NumLock on. The kernel seems to pick up on this and sets NumLock on in every virtual terminal, even though I've used setleds to turn it off as soon as I can in the boot process. I'd like to make it off. Is there something I can change to make the kernel so decide?

A computer I had in the '90s had NumLock setting as a settable feature in the BIOS. This computer doesn't.
 
Old 10-26-2020, 08:36 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,415
Blog Entries: 28

Rep: Reputation: 6166Reputation: 6166Reputation: 6166Reputation: 6166Reputation: 6166Reputation: 6166Reputation: 6166Reputation: 6166Reputation: 6166Reputation: 6166Reputation: 6166
If you turn the numlock off, then reboot, does the numlock come back on at startup? If so, I can't imagine how it can be anything other than a BIOS setting.

It's been a long time since I've mucked about in a BIOS, but I recall that some of the were much easier to navigate than others. Perhaps a web search will turn up a copy of the manual for the particular type/version of BIOS in that machine.
 
Old 10-27-2020, 01:21 AM   #3
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,982

Original Poster
Rep: Reputation: 271Reputation: 271Reputation: 271
Quote:
Originally Posted by frankbell View Post
If you turn the numlock off, then reboot, does the numlock come back on at startup?
yes.

Quote:
Originally Posted by frankbell View Post
If so, I can't imagine how it can be anything other than a BIOS setting.
It could be in ROM.

I assume that the kernel has taken it over after it loads, which should mean I can get the kernel to police this for me.


Quote:
Originally Posted by frankbell View Post
It's been a long time since I've mucked about in a BIOS, but I recall that some of the were much easier to navigate than others. Perhaps a web search will turn up a copy of the manual for the particular type/version of BIOS in that machine.
I've already consulted the manual.
 
Old 10-27-2020, 03:15 AM   #4
Dennis2
LQ Newbie
 
Registered: Apr 2018
Posts: 13

Rep: Reputation: Disabled
Yes it is in the bios, first thing I always change.
Dennis
 
Old 10-27-2020, 08:29 AM   #5
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,982

Original Poster
Rep: Reputation: 271Reputation: 271Reputation: 271
Quote:
Originally Posted by Dennis2 View Post
Yes it is in the bios, first thing I always change.
It isn't on this computer.
 
Old 10-27-2020, 12:21 PM   #6
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Salix
Posts: 6,155

Rep: Reputation: 2318Reputation: 2318Reputation: 2318Reputation: 2318Reputation: 2318Reputation: 2318Reputation: 2318Reputation: 2318Reputation: 2318Reputation: 2318Reputation: 2318
It's nothing to do with the BIOS — it's an init script. In System V init, the file is /etc/rc.d/init.d/numlock, but no doubt Slackware does something different!
 
Old 10-27-2020, 04:43 PM   #7
henderson
Member
 
Registered: Mar 2018
Distribution: Linux Mint
Posts: 43

Rep: Reputation: 34
Have you looked in ROM? Is it there? I want to know, too, because my laptop also starts with Num Lock. I see no ROM in Bios.
 
Old 10-27-2020, 05:16 PM   #8
sgosnell
Senior Member
 
Registered: Jan 2008
Location: Baja Oklahoma
Distribution: Debian Stable and Unstable
Posts: 1,943

Rep: Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542
What distro and desktop environment? There are settings in most DEs for numlock. That won't affect it before the DE starts, but will afterwards.
 
Old 10-27-2020, 07:18 PM   #9
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,275

Rep: Reputation: 5342Reputation: 5342Reputation: 5342Reputation: 5342Reputation: 5342Reputation: 5342Reputation: 5342Reputation: 5342Reputation: 5342Reputation: 5342Reputation: 5342
"numlockx", maybe?

http://manpages.ubuntu.com/manpages/...umlockx.1.html
 
Old 10-28-2020, 12:11 AM   #10
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,982

Original Poster
Rep: Reputation: 271Reputation: 271Reputation: 271
Quote:
Originally Posted by DavidMcCann View Post
It's nothing to do with the BIOS — it's an init script. In System V init, the file is /etc/rc.d/init.d/numlock, but no doubt Slackware does something different!
Slackware lacks this, but the BIOS can be involved. All my previous computers started with numlock off except the 1 that allowed setting it in the BIOS. This computer starts with it on and it's not settable in the BIOS. I was wondering if Linux took a cue from the BIOS's setting.

Quote:
Originally Posted by henderson View Post
Have you looked in ROM? Is it there? I want to know, too, because my laptop also starts with Num Lock. I see no ROM in Bios.
It's not in my BIOS but is in some. I'm sure you can figure yours out.

Quote:
Originally Posted by sgosnell View Post
What distro and desktop environment? There are settings in most DEs for numlock. That won't affect it before the DE starts, but will afterwards.
Slackware. I use FVWM95 for my window manager, no desktop: I start only an xterm, run all commands from the command line.

Quote:
Originally Posted by dugan View Post
"numlockx", maybe?
Ubuntu has this; some distributions have rc.numlock.

@rinaldij posted in another thread:
Code:
 for n in 1 2 3 4 5 6 7 8 9 10 
do
 setleds -num < /dev/tty$n 
done
in rc.local turns it off for every virtual terminal, but not xterm, my real target.

It annoys me that X turns on the NumLock LED (but not the state!) when it starts and every time it's switched to. Because I never had the problem before, and this computer turns NumLock on at boot, I wondered if they are related.
 
Old 10-28-2020, 05:32 AM   #11
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,175
Blog Entries: 1

Rep: Reputation: 2042Reputation: 2042Reputation: 2042Reputation: 2042Reputation: 2042Reputation: 2042Reputation: 2042Reputation: 2042Reputation: 2042Reputation: 2042Reputation: 2042
Quote:
"numlockx", maybe?
Ubuntu has this; some distributions have rc.numlock.
There is numlockx in slackbuilds
You can install it and add in ~/.xinitrc "/usr/bin/numlockx off" to turn numlock off in X.
 
Old 10-29-2020, 12:12 AM   #12
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,982

Original Poster
Rep: Reputation: 271Reputation: 271Reputation: 271
Quote:
Originally Posted by bathory View Post
There is numlockx in slackbuilds
I downloaded the source and built it.

Quote:
Originally Posted by bathory View Post
You can install it and add in ~/.xinitrc "/usr/bin/numlockx off" to turn numlock off in X.
It doesn't work for me. I searched and found a few others with my complaint, but no solutions. I had a complete set of X docs 30 years ago. It's hard to believe there isn't a setting, an XkbOptions, for this, but I can't find it.
 
Old 10-30-2020, 12:14 AM   #13
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,919
Blog Entries: 1

Rep: Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082
My old Satellite with GM965 chipset and openSUSE Leap has no NUM setting in BIOS, no separate NUM pad, no NUM key, and behaves NAICT like NUM is off. When I plug in a USB keyboard, NUM is off, and turning it on produces entirely expected results.

Have you ever tried booting something other than Slack to see if your's behavior then differs?
 
Old 10-30-2020, 03:45 AM   #14
Roken
Member
 
Registered: Oct 2011
Location: Warrington, UK
Distribution: Arch local, Debian on VPS, several RPIs.
Posts: 300
Blog Entries: 1

Rep: Reputation: 55
A simplified variant of the above:

Code:
#!/bin/bash

for tty in /dev/tty{1..6}
do
    /usr/bin/setleds -D -num < "$tty";
done
 
Old 11-12-2020, 10:06 PM   #15
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,982

Original Poster
Rep: Reputation: 271Reputation: 271Reputation: 271
Code:
setleds -num < /dev/tty11
in startx solved my problem. I have 10 virtual terminals, so tty11 is the one X uses.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting numlock on at boot, editing the Init/Default file, don't want to mess it up sandaili Fedora 2 07-08-2008 04:35 PM
Can I set numlock to be on by default? magesing Debian 5 02-22-2006 06:11 AM
NumLock off by default? stickfun Linux - Newbie 4 10-30-2005 10:08 AM
numlock to be on by default? marsguy Linux - Hardware 3 04-03-2005 06:11 PM
Set Numlock Off By Default On A Suse 9.1 Laptop? FluffyPanda Linux - Laptop and Netbook 1 07-28-2004 03:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration