Since I upgraded to Ubuntu 20.04 I lost Num Lock during boot. Is there any way to keep Num Lock active during boot as it was before?
5 Answers
Introduction
Num Lock is a feature that allows users to use the numeric keypad on their keyboard. In Ubuntu 20.04, some users have reported that Num Lock is not activated by default during boot. This can be frustrating for those who use the numeric keypad frequently. However, there is a way to activate Num Lock by default during boot. In this blog post, we will discuss how to activate Num Lock by default on Ubuntu 20.04 boot.
Method 1: Using the System Settings
The first method to activate Num Lock by default on Ubuntu 20.04 boot is through the System Settings. Here are the steps:
1. Click on the Activities button located in the top left corner of the screen.
2. Type “Settings” in the search bar and click on the System Settings icon.
3. Click on the Universal Access option located in the left sidebar.
4. Scroll down to the Typing Assist option and click on it.
5. Toggle the Num Lock on option to the on position.
By following these steps, Num Lock will be activated by default during boot. However, this method may not work for all users. If this method does not work for you, try the second method.
Method 2: Editing the LightDM Configuration File
The second method to activate Num Lock by default on Ubuntu 20.04 boot is by editing the LightDM configuration file. Here are the steps:
1. Open the Terminal by pressing Ctrl + Alt + T.
2. Type the following command to open the LightDM configuration file:
sudo nano /etc/lightdm/lightdm.conf.d/50-unity-greeter.conf
3. Add the following line to the end of the file:
greeter-setup-script=/usr/bin/numlockx on
4. Save and exit the file by pressing Ctrl + X, then Y, and then Enter.
5. Reboot your system.
By following these steps, Num Lock will be activated by default during boot. This method should work for most users. However, if you encounter any issues, try the third method.
Method 3: Editing the GRUB Configuration File
The third method to activate Num Lock by default on Ubuntu 20.04 boot is by editing the GRUB configuration file. Here are the steps:
1. Open the Terminal by pressing Ctrl + Alt + T.
2. Type the following command to open the GRUB configuration file:
sudo nano /etc/default/grub
3. Find the following line in the file:
GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash”
4. Add “numlock=on” to the end of the line, so it looks like this:
GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash numlock=on”
5. Save and exit the file by pressing Ctrl + X, then Y, and then Enter.
6. Update the GRUB configuration by typing the following command:
sudo update-grub
7. Reboot your system.
By following these steps, Num Lock will be activated by default during boot. This method should work for most users. However, if you encounter any issues, try the fourth method.
Method 4: Using the Numlockx Package
The fourth method to activate Num Lock by default on Ubuntu 20.04 boot is by using the Numlockx package. Here are the steps:
1. Open the Terminal by pressing Ctrl + Alt + T.
2. Type the following command to install the Numlockx package:
sudo apt-get install numlockx
3. Type the following command to open the LightDM configuration file:
sudo nano /usr/share/lightdm/lightdm.conf.d/50-unity-greeter.conf
4. Add the following line to the end of the file:
greeter-setup-script=/usr/bin/numlockx on
5. Save and exit the file by pressing Ctrl + X, then Y, and then Enter.
6. Reboot your system.
By following these steps, Num Lock will be activated by default during boot. This method should work for most users. However, if you encounter any issues, try the fifth method.
Method 5: Using the Xinitrc File
The fifth method to activate Num Lock by default on Ubuntu 20.04 boot is by using the Xinitrc file. Here are the steps:
1. Open the Terminal by pressing Ctrl + Alt + T.
2. Type the following command to open the Xinitrc file:
sudo nano ~/.xinitrc
3. Add the following line to the end of the file:
/usr/bin/numlockx on
4. Save and exit the file by pressing Ctrl + X, then Y, and then Enter.
5. Reboot your system.
By following these steps, Num Lock will be activated by default during boot. This method should work for most users. However, if you encounter any issues, try the sixth method.
Method 6: Using the Startup Applications
The sixth method to activate Num Lock by default on Ubuntu 20.04 boot is by using the Startup Applications. Here are the steps:
1. Click on the Activities button located in the top left corner of the screen.
2. Type “Startup Applications” in the search bar and click on the icon.
3. Click on the Add button located in the bottom left corner of the window.
4. Type “Num Lock” in the Name field.
5. Type “/usr/bin/numlockx on” in the Command field.
6. Click on the Add button.
7. Reboot your system.
By following these steps, Num Lock will be activated by default during boot. This method should work for most users.
Conclusion
In this blog post, we have discussed six different methods to activate Num Lock by default on Ubuntu 20.04 boot. These methods include using the System Settings, editing the LightDM configuration file, editing the GRUB configuration file, using the Numlockx package, using the Xinitrc file, and using the Startup Applications. By following these methods, you should be able to activate Num Lock by default on Ubuntu 20.04 boot.
To activate Num Lock by default on Ubuntu 20.04 during boot, you can follow these steps:
- Open the Terminal by pressing
Ctrl+Alt+T
or by searching for “Terminal” in the Dash. - Run the following command to edit the Grub configuration file:
sudo gedit /etc/default/grub
- This will open the Grub configuration file in a text editor. Locate the following line:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
- Add the following text to the end of this line:
vt.force_consoled=1
The line should now look like this:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash vt.force_consoled=1"
- Save the file and exit the text editor.
- Run the following command to update the Grub configuration:
sudo update-grub
- Restart your computer. Num Lock should now be active during boot.
Note: If this does not work, you may need to install the numlockx
package and add the following line to your ~/.bashrc
file:
if [ -x /usr/bin/numlockx ]; then
numlockx on
fi
This will enable Num Lock every time you log in to your user account.
Peter Miller92 Posted May 21, 20200 Comments
In Ubuntu 20.04 try:
org.gnome.desktop.peripherals.keyboard remember-numlock-state true
org.gnome.desktop.peripherals.keyboard numlock-state false
You can configure the Boolean values as you like.
@Peter: Aren’t you forgetting something here? You can’t just paste this into a terminal session, you need to prepend the setting keys with gsettings set
. Also, it’s worthwhile knowing what numlock settings exist so check that with gsettings list-recursive |grep -e numlock
:
$ gsettings list-recursively |grep -e numlock
com.canonical.unity.settings-daemon.peripherals.keyboard remember-numlock-state true
com.canonical.unity.settings-daemon.peripherals.keyboard numlock-state 'unknown'
org.gnome.desktop.peripherals.keyboard remember-numlock-state true
org.gnome.desktop.peripherals.keyboard numlock-state false
I’d have to actually run the experiment, but since I use GNOME-Flashback, chances are modifying the com.canonical.unity keys won’t influence my GDM/GNOME-Flashback session.
$ gsettings set org.gnome.desktop.peripherals.keyboard numlock-state true && gsettings list-recursively |grep 'gnome.desktop.*numlock' org.gnome.desktop.peripherals.keyboard remember-numlock-state true org.gnome.desktop.peripherals.keyboard numlock-state true
Try to install numlockx via terminal.
sudo apt install numlockx
Search for Startup Applications:
Set a Startup Application Preference with a command “numlockx on”.
Enjoy!
In Ubuntu 20.04 try:
org.gnome.desktop.peripherals.keyboard remember-numlock-state true
org.gnome.desktop.peripherals.keyboard numlock-state false
You can configure the Boolean values as you like.