LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   HOWTO: Debian 7 (Wheezy) LXDE Auto Numlock, both BEFORE and AFTER login (https://www.linuxquestions.org/questions/debian-26/howto-debian-7-wheezy-lxde-auto-numlock-both-before-and-after-login-4175500323/)

luvr 04-02-2014 10:06 AM

HOWTO: Debian 7 (Wheezy) LXDE Auto Numlock, both BEFORE and AFTER login
 
These days, I'm getting more and more questions from people who own fairly old computers that have been running (or, often, rather crawling) Windows XP so far. Instead of dumping their old hardware and buying new PCs with the dreaded Windows 8 system, they come and ask me if there isn't anything I can do to revive their computers.

Since these computers are not particularly powerful, I went looking for a fairly lightweight desktop, and I opted for LXDE, specifically the Debian 7 Wheezy LXDE distribution.

Most people appear quite happy about this choice, except that I kept getting one complaint over and over again: "The numeric keypad doesn't work!" Actually, this issue is a simple matter of NumLock being turned off by default, and of hitting the NumLock key to turn it on. One additional inconvenience, as it turned out, was that NumLock was automatically turned off before login, and (even after it was manually turned on at the login screen) it was turned off again after the login process was completed. This behaviour was getting on people's nerves, so I went looking for a solution.

This post serves to document the solution that I have come up with.

First, it is important to understand which Display Manager your system is running. You can find this out with the following command:
Code:

cat /etc/X11/default-display-manager
The output from this command should tell you that Debian 7 Wheezy LXDE uses the LightDM Display Manager, "/usr/sbin/lightdm". Armed with this knowledge, you can configure your system such that NumLock will be turned on before the user logs in. Just follow these steps:
  • Install the "numlockx" package (as root, obviously):
    Code:

    apt-get install numlockx
  • Edit the LightDM configuration file, "/etc/lightdm/lightdm.conf", and (again, as root) add the following line under the "[SeatDefaults]" section heading:
    Code:

    greeter-setup-script=/usr/bin/numlockx on
    NOTE: If you are using a different Display Manager, then the LightDM configuration file will not be used, and you will have to take some other action instead.
Next time you reboot, NumLock will be turned on by the time the login screen is displayed. Once you log in to your LXDE session, however, NumLock will be OFF again.

To ensure that NumLock will be turned ON again once you are logged in, you will need to make one more edit: Still as root, add the following line to the file "/etc/xdg/lxsession/LXDE/autostart":
Code:

/usr/bin/numlockx on
Note that the existing lines in the file will likely all start with an '@'-sign. You should not, however, type an '@'-sign on the newly added line. (If you did, then numlockx would be restarted whenever it ended— which is definitely not what you would want to happen.)

From now on, NumLock will be turned on not only when the login screen is displayed, but also after the user logs in to start the LXDE desktop environment.

k3lt01 04-03-2014 03:05 AM

Hi luvr, it's been ages since I read anything you wrote (on another forum) but your clear and concise style has never changed. Good to see you're still working as hard as ever.

luvr 04-07-2014 03:11 PM

Quote:

Originally Posted by k3lt01 (Post 5145780)
Hi luvr, it's been ages since I read anything you wrote (on another forum) but your clear and concise style has never changed. Good to see you're still working as hard as ever.

Well, thank you for your nice words! I must admit, though, that I've been down and out for a while, but that I'm currently in the process of slowly recovering to full force.

widget 04-08-2014 09:00 PM

Very clear and concise. Thanks a lot.

Only thing that you need to do is mark this thread as solved so that folks that use the forum search function will find it and use it.


All times are GMT -5. The time now is 07:47 AM.