Q. How do I make sure that numlock is always turn on GNOME Linux desktop system?
A. You need to install numlockx package, which enable NumLock in X11 sessions.
This little software allows you to start X with NumLock turned on which is a feature that a lot of people seem to miss and nobody really knew how to achieve this.
To install numlockx type the command:
# apt-get install numlockx
Now open your /etc/X11/gdm/Init/Default file and add line:
/usr/bin/numlockx on
Save and close the file.
You can also add line to /etc/X11/xinit/xinitrc. Open file:
# vi /etc/X11/xinit/xinitrc
At the beginning of file add line
/usr/bin/numlockx on
Save and close the file.
If you’re not root (or don’t have access to root account) and therefore you can modify neither config file, you can use your ~/.xinitrc ( in your home directory /home/you/.xinitrc file).
$ cd
$ vi .xinitrc
Append following line
/usr/bin/numlockx on
Save and close the file.
Reboot the system or restart the GNOME.
🐧 1 comment so far... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |
On nowadays’ distros xinitrc file has been deprecated in favor of xinitrc.d script directory, which provides better maintainability for packagers.
So, instead of editing
it’s better to create a script like this:
Then paste this code (don’t forget shebang line):
And lastly, give that file execute permissions.
Reboot to test it, and done.