Find the answer to your Linux question:
Results 1 to 8 of 8
NE1 know how to get the NUM lock to automagikly come on during boot? Its only a minor annoyance but it IS annoying...
  1. #1
    Linux Newbie
    Join Date
    Dec 2005
    Location
    Pennsylvania
    Posts
    102

    Talking num lock

    NE1 know how to get the NUM lock to automagikly come on during boot?
    Its only a minor annoyance but it IS annoying

  2. #2
    Linux Engineer
    Join Date
    Apr 2005
    Location
    Belgium
    Posts
    1,429
    What desktop environment do you use? You can set it in KDE's control center, never checked for Gnome though.
    ** Registered Linux User # 393717 and proud of it ** Check out www.zenwalk.org
    ** Zenwalk 2.8 - Xfce 4.4 beta 2- 2.6.17.6 kernel = Slack on steroids! **

  3. #3
    Linux Newbie
    Join Date
    Dec 2005
    Location
    Pennsylvania
    Posts
    102
    Sorry...i use gnome on Ubuntu
    And I would like it to come on BEFORE login, as my password contains #'s

  4. #4
    Linux Newbie
    Join Date
    Nov 2004
    Posts
    239
    I seem to remember there is a kernel option for it.

    Like you, i find this annoying, but in the long run, a custom kernel is more annoying. Maybe there is a script / command that will do it that can run at login?

  5. #5
    Linux Enthusiast
    Join Date
    Aug 2005
    Location
    Hell
    Posts
    514
    numlockx (apt-get install numlockx) will turn on the Num Lock when X loads. I don't know if it comes on before login though.

  6. #6
    Linux Engineer
    Join Date
    Nov 2004
    Location
    Ft. Polk, LA
    Posts
    796
    Code:
    for tty in /dev/tty[1-6]; do
        /usr/bin/setleds -D +num < $tty
    done
    This should be in one of the boot scripts. This will turn numlock on for the first 6 virtual consoles. If you have more or less, you will want to change that.

    See link for more info and how to do it when starting X too.

    http://www.linuxfromscratch.org/hint...es/numlock.txt

  7. #7
    Linux Engineer
    Join Date
    Apr 2005
    Location
    Belgium
    Posts
    1,429
    NumlockX - as its name says - only provides a numlock-on functionality within X. So not within virtual terminals (tty2, ...). When your login manager appears, and numlockx is configured right, you'll have an activated numlock. I know KDE has that functionality built-in, which makes me suppose Gnome does also. Not sure though.
    ** Registered Linux User # 393717 and proud of it ** Check out www.zenwalk.org
    ** Zenwalk 2.8 - Xfce 4.4 beta 2- 2.6.17.6 kernel = Slack on steroids! **

  8. #8
    Just Joined!
    Join Date
    Aug 2011
    Posts
    1

    tty0 on with init script

    Quote Originally Posted by valan View Post
    Code:
    for tty in /dev/tty[1-6]; do
        /usr/bin/setleds -D +num < $tty
    done
    the above script may start at 0.
    it needs to be run as root as /dev/tty? will deny permission for regular user (or maybe it's just me).

    too bad Linux doesn't respect bios settings for this.

    because kde settings panel is not being respected I had to write an init.d script.
    Code:
    #!/bin/sh
    ## 
    ### BEGIN INIT INFO
    # Provides:          setled
    # Required-Start:     
    # Required-Stop:     
    # Default-Start:     2 3 4 5
    # Default-Stop:      0 1 6
    ### END INIT INFO
    #  update-rc.d setled.sh defaults 99 99
    ### 
    
    PATH=/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin
    DAEMON=""
    NAME=setled
    DESC="turns numberlock on and off"
    
    setleds -D +num < /dev/tty0
    
    case "$1" in
      start)
        echo -n "Starting $DESC: $NAME"
          setleds -D +num < /dev/tty0
        echo "."
        ;;
      stop)
        echo -n "Stopping $DESC: $NAME"
          setleds -D -num < /dev/tty0
        echo "."
        ;;
      force-reload|restart)
        echo -n "Restarting $DESC: $NAME"   
        setleds -D +num < /dev/tty0
        ;;
      *)
        echo "hey it just don't matter setting num lock on"
          setleds -D +num < /dev/tty0
        exit 0
        ;;
    esac
    
    exit 0
    as root save to /etc/init.d/setled (or whatever name) (for gnu/Debians anyway)
    type
    chmod +x /etc/init.d/setled
    update-rc.d setled defaults 99 99
    (the 99 means that there's not much chance of another script turning the numlock off)

    For those who prefer numlock off just switch the pluses and minuses.

    rewrite the script for cap lock and scroll lock (whatever that does- my scroll lock led doesn't even light)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •