Num Lock in Stretch [SOLVED]

New to Debian (Or Linux in general)? Ask your questions here!

Num Lock in Stretch [SOLVED]

Postby cybermcm » 2017-07-21 14:20

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.
cybermcm
 
Posts: 9
Joined: 2017-07-21 13:22

Re: Num Lock in Stretch

Postby Bulkley » 2017-07-21 14:49

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.
Bulkley
 
Posts: 5848
Joined: 2006-02-11 18:35

Re: Num Lock in Stretch

Postby cybermcm » 2017-07-21 16:31

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....
cybermcm
 
Posts: 9
Joined: 2017-07-21 13:22

Re: Num Lock in Stretch

Postby Caitlin » 2017-07-23 01:28

But is your computer turned on? :mrgreen:

Caitlin
Caitlin
 
Posts: 269
Joined: 2012-05-24 07:32

Re: Num Lock in Stretch

Postby cybermcm » 2017-07-23 04:35

If you have a solution I'd be happy if you share it...
cybermcm
 
Posts: 9
Joined: 2017-07-21 13:22

Re: Num Lock in Stretch

Postby alan stone » 2017-07-23 08:02

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

For reference: for a X11 session there's numlockx.
User avatar
alan stone
 
Posts: 267
Joined: 2011-10-22 14:08
Location: In my body.

Re: Num Lock in Stretch

Postby squeeze » 2017-07-23 09:22

“Have you tried turning it off and on again?”
User avatar
squeeze
 
Posts: 299
Joined: 2010-06-14 23:16
Location: thimbleweedpark

Re: Num Lock in Stretch

Postby cybermcm » 2017-07-23 13:08

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
cybermcm
 
Posts: 9
Joined: 2017-07-21 13:22


Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 6 guests

fashionable