Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Num Lock in Stretch [SOLVED]

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
cybermcm
Posts: 9
Joined: 2017-07-21 13:22

Num Lock in Stretch [SOLVED]

#1 Post by cybermcm »

Hi,

Simple problem, no solution (at least I was not able to find a simple one). I'm using Debian for my servers. Up until now I activated num lock for the bash console in /etc/kbd/config (LEDS=+num).
/etc/kbd/config doesn't exist any more in Stretch. What is the proper replacement for this (activation of num lock for the bash console on booting)?

BR,
CyberMCM
Last edited by cybermcm on 2017-07-26 19:55, edited 2 times in total.

Bulkley
Posts: 6386
Joined: 2006-02-11 18:35
Has thanked: 2 times
Been thanked: 39 times

Re: Num Lock in Stretch

#2 Post by Bulkley »

Sorry, I can't remember that specific instruction but the tool you want is setxkbmap

Code: Select all

man setxkbmap
Also, there was a similar thread on keyboard settings about two weeks ago so search this forum. Search Googles database.

cybermcm
Posts: 9
Joined: 2017-07-21 13:22

Re: Num Lock in Stretch

#3 Post by cybermcm »

believe me, I searched here and on Google but found nothing.
setxkbmap seems to be for a x environment, I only use terminal with bash, I don't think this helps. But if anyone has specific instructions I'd love to hear it....

Caitlin
Posts: 329
Joined: 2012-05-24 07:32
Has thanked: 3 times
Been thanked: 2 times

Re: Num Lock in Stretch

#4 Post by Caitlin »

But is your computer turned on? :mrgreen:

Caitlin

cybermcm
Posts: 9
Joined: 2017-07-21 13:22

Re: Num Lock in Stretch

#5 Post by cybermcm »

If you have a solution I'd be happy if you share it...

User avatar
alan stone
Posts: 269
Joined: 2011-10-22 14:08
Location: In my body.

Re: Num Lock in Stretch

#6 Post by alan stone »

Is it this you're looking for: enabling NumLock for Virtual Consoles (TTYs)?

For reference: for a X11 session there's numlockx.

User avatar
squeeze
Posts: 299
Joined: 2010-06-14 23:16
Location: thimbleweedpark

Re: Num Lock in Stretch

#7 Post by squeeze »

“Have you tried turning it off and on again?”

cybermcm
Posts: 9
Joined: 2017-07-21 13:22

Re: Num Lock in Stretch

#8 Post by cybermcm »

Thanks for your answers. I finally ended up with
1) nano /etc/rc.local

Code: Select all

#!/bin/bash
# Turn Numlock on for the TTYs:
for tty in /dev/tty[1-6]; do
    /usr/bin/setleds -D +num < "$tty";
done
2) chmod +x /etc/rc.local

Comparing to versions < Debian 9 this seems rather complicated and also deprecated, I think it should be setup as a systemd service after all.

Alternative:
1) nano /usr/bin/numlock
take code from above
2) nano /etc/systemd/system/numlock.service

Code: Select all

[Unit]
Description=numlock

[Service]
ExecStart=/usr/bin/numlock
StandardInput=tty
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target
3) systemctl enable numlock.service

Post Reply