I am trying to force numlock to be on upon initial boot at the login screen on Ubuntu 12.04. The only solutions I have found so far switch numlock on only after initial login.
I'm looking to force numlock to be on when the login screen is displayed, and before the user has logged in. Can anyone assist?
On many machines, you can set whether or not Number Lock is turned on on boot, in the BIOS settings (accessible when you first power on the machine).
Otherwise, there are a number of ways to enable (or disable) Number Lock in software, depending on your specific needs. The most useful ways are listed here.
If you want Number Lock turned on when Ubuntu starts (not before that on the GRUB menu, and not afterwards when logging in, and not just for specific virtual consoles), then install
numlockx
and make the initialization script/etc/init.d/rc.local
use it to enable Number Lock:Source: NumLock, by Contributors to the Ubuntu documentation wiki, last line taken verbatim (as this source permits).
Here's what worked for me:
Ensure that numlockx is installed:
Edit the file
/etc/lightdm/lightdm.conf
:Add the following line to the file:
Press Ctrl + X to exit Nano.
14.04
Yes, use
locate
command as follow:The output is:
So, the file you need to edit is the above file.
Add this line at the end of file:
For Enabling it on Login Screen
First, ensure that numlockx is installed, by typing these in terminal:
Then, edit the file /etc/lightdm/lightdm.conf
Add the following line to the file:
For Enabling Numlock by Default after Logging In..
I have done this, and it worked for me. First, make sure you have universe repository added.
Just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the commands below.
Now that
numlockx
is installed, create a file namedDefault
in/etc/X11/
with these contents:Turn off your Num Lock and reboot. Voilà!
Open terminal by Ctrl+Alt+T
Run commands
That's it...
Solution by
To Keep it on
To Keep it off
You can configure the way you like.
Xubuntu specific.
Versions from 14.10 include a pkexec mousepad action.
Follow previous answers to install numlockx
Edit /usr/share/lightdm/lightdm.conf.d/60-lightdm-gtk-greeter.conf as root
Alt+F2 then
Add
then save.
Most BIOSes allow this to be enabled. You can check your BIOS for this feature.
OR
Go to : System Settings -> Keyboard Layout -> Options -> Miscellaneous compatibility options
Check "Default numeric keypad keys"
Sources : https://help.ubuntu.com/community/NumLock
Here is a little
bash
script which takes care of everything in an automated way:Do not forget to first make your
bash
script executable withchmod +x scriptname
, then execute it with./scriptname
.If you are using lightdm you can add a file
/etc/lightdm/slick-greeter.conf
withThat will enable numlock at the login screen. I have encountered a small bug in the panel LED applet that shows indicators for numlock, scroll lock and caps lock. If you use this method then the indicator will show off, despite numlock being on. If you toggle numlock it will show the correct status.
To fix this add a startup application with the startup application app and add this command.
Of course you need to install numlockx. If you do not use the indicator applet then you can probably ignore this last part.