LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   Boot with numlock on? Possible? (https://www.linuxquestions.org/questions/fedora-35/boot-with-numlock-on-possible-180272/)

MillyFish 05-11-2004 08:21 AM

Boot with numlock on? Possible?
 
Hi all

Is it possible to boot the Fedora Core 1 system and force the numlock to be on. When I boot into Win98 the numlock is on but if I boot into Fedora it stays off. I use the number pad instinctively and get into a flap when it doesnt work as I expect.

If it is possible, how do I do it?

Thanks

Millyfish

Andrew Benton 05-11-2004 10:22 AM

If you have a C compiler installed, download this ftp://ftp.silug.org/pub/ltsp/setnumlock.tar.gz
then
Code:

tar xzf setnumlock.tar.gz
cd setnumlock
make
su
password
make install
chmod 755 /usr/bin/setnumlock

Then you need to set Gnome to run setnumlock when you log in. The menus are arranged differently in Fedora and I can't remember where this is but in regular Gnome 2.6 it's Desktop Preferences > Advanced > Sessions > Startup Programs > Add and then fill in setnumlock in the Startup Command box. I'll reboot into Fedora and edit this.

Go to the Hat Menu > Preferences > More Preferences > Sessions > click the Startup Programs tab then > Add and for Startup Command enter setnumlock

marghorp 05-11-2004 03:17 PM

If you are using KDE in Fedora, go to KDE control center and you can make it happen there whithout installing any packages. You will find it under Hardware something(I use slovenian distro) and then Keyboard. There is an option whether to have NumLock on or of at boot and loading linux.

Peace!

Hope it helps you(if you have KDE).

Espique 05-11-2004 06:51 PM

hum. apperantly Core2 does not have the starup programs in the preferences menu. where else could that be?

sascha

marghorp 05-11-2004 06:53 PM

KDE control center? Don't you have it? Are you using GNOME?

Espique 05-11-2004 07:18 PM

sorry. I ment the startup folder in gnome. I saw that mentioned elsewhere too, it's supposed to be in the gnome-control-center, but it is not. at least not here on the Core2 box. any idea?

thanks,
sascha

MillyFish 05-13-2004 02:12 AM

Millyfish here!

Hope nobody thinks I'm ignoring my own thread - anyone spotting my other post in Newbies will know I've had a bigger fish to fry. Now that that is sorted though, I will give your suggestions a try when I get back home.

Post results later.

Phil

Andrew Benton 05-25-2004 02:28 PM

Quote:

Originally posted by Espique
hum. apperantly Core2 does not have the starup programs in the preferences menu. where else could that be?

sascha

Where indeed. I've just installed Fedora core 2 and I can't get setnumlock working as there's no Sessions option on the Hat Menu > Preferences > More Preferences > Sessions menu. Does anyone know how to run a command when you log in to gnome on Fedora Core 2?

marghorp 05-25-2004 02:31 PM

It is easy in KDE and KDE is so beautifull in this time of year with 3.2.2 coming with Fedora Core 2.

I have no idea for GNOMe.

Andrew Benton 05-25-2004 03:31 PM

I fixed it, I run gnome-session-properties with a command from the terminal. How daft that the application is there but they've removed it from the menus...

wiraone 05-26-2004 08:43 AM

Quote:

Originally posted by Andrew Benton
I fixed it, I run gnome-session-properties with a command from the terminal. How daft that the application is there but they've removed it from the menus...
It wasn't removed intentionally .. but I guess there is a bug somewhere in the .desktop file which makes it not showing up. This is one of the few cosmetic problems with FC2 ... and it seems that nobody really care about it ..

marghorp 05-26-2004 09:22 AM

Yes, we all use KDE

smokybobo 05-26-2004 09:41 AM

Hello, I'm on a debian system, but I thought I'd share my solutions which should be easy enough to adapt to a fedora core distro provided you know where your startup scripts are.

Numlock when booting computer (this is `/etc/init.d/custom-numlock` on my system):

Code:

#!/bin/sh

SETLEDS=/usr/bin/setleds

case "$1" in
  start)
        echo -n "Enabling numlock on consoles: "
        if [ -e /dev/.devfsd ]; then
            for tty in /dev/vc/[1-9]; do
              $SETLEDS -D +num < $tty
            done
        else
            for tty in /dev/tty[1-9]; do
              $SETLEDS -D +num < $tty
            done
        fi
        echo "numlock."
      ;;
  stop)
        echo -n "Turning numlock off on consoles: "
        if [ -e /dev/.devfsd ]; then
            for tty in /dev/vc/[1-9]; do
              $SETLEDS -D -num < $tty
            done
        else
            for tty in /dev/tty[1-9]; do
              $SETLEDS -D -num < $tty
            done
        fi
        echo "numlock."
      ;;
  restart|reload|force-reload)
        /etc/init.d/custom-numlock stop
        /etc/init.d/custom-numlock start
      ;;
  *)
        echo "Usage: /etc/init.d/custom-numlock {start|stop|restart|reload|force-reload}"
        exit 1
      ;;
esac

exit 0

For the following, you need a program called numlockx .

For starting X from the console i.e. via startx, stick the following in `$HOME/.xinitrc` (note the path to the numlockx program may be different for your distro):

Code:

#! /bin/sh

/usr/X11R6/bin/numlockx on


If you run from gdm, on my debian system I stick the above in the file `/etc/gdm/Init/Default`. For kdm, I stick it in `/etc/kde3/kdm/Xsetup`. Again, these are on a debian system, so the locations of the configuration files for gdm and kdm are most likely different.


If you don't care for a toggled numlock at a display manager but want it on when in a DE or WM, stick the above code in `$HOME/.xsession`

The above are merely alternative suggestions to what's already posted, but I like these solutions as they are more or less independent of the DE or WM you may want to run.

KimMcCall 06-10-2004 08:01 AM

Having run into this same problem, but being too lame to think of invoking the wizard from the command line (actually, see end of message for rationalized reason), I tried figuring out just what the wizard does and then doing that by hand.

So, in case anyone wonders, the Sessions wizard (is that the right term?) is a graphical way of editing the file
~/.gnome2/session-manual

In my system I like to run both setnumlock and ssh-add whenever I start up GNOME.
Here, between the ***...*** lines, is the content of my ~/.gnome2/session-manual

*******************************************************************************

[Default]
num_clients=2
0,RestartStyleHint=3
0,Priority=50
0,RestartCommand=/usr/bin/setnumlock
1,RestartStyleHint=3
1,Priority=70
1,RestartCommand=/usr/bin/ssh-add
*******************************************************************************

You will notice that the file starts with a blank line. (This is probably not important, but who knows?)
The num_clients value should be the number of things you want to start up.
The priority numbers may be confusing and tricky. A higher number means a lower priority.
If you're running ssh-add, you should assign it a high number, so it runs last. The RH9 documentation suggested that 70 would be a good value.
I hope the rest is clear enough. I have no idea what the RestartStyleHint is about, but this works for me.

Hope someone finds this useful. I'm about to start developing a perl script for customizing a fresh installation, so I wanted to know how to do this sort of thing without a GUI.

Kim

KimMcCall 06-10-2004 08:05 AM

Oh, and for what it's worth, I pretty strongly disagree with wiraone's assessment that no one cares that this was accidentally left out of the menus. I found it quite frustrating, and I can hardly be the only one.

Kim


All times are GMT -5. The time now is 01:55 PM.