Last active
December 4, 2024 12:12
-
-
Save mihir-kumar-thakur/b0c97aacfb980e8f5172a807fe82a36f to your computer and use it in GitHub Desktop.
disable-keyboard-on-boot-ubuntu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Disable Laptop Keyboard in Ubuntu | |
Taken From :- https://blog.hostonnet.com/laptop-keyboard-ubuntu | |
To disable laptop built in keyboard in Ubuntu, first you need to identify the device id for keyboard. | |
Now run xinput –list command to get list of all input devices | |
hostonnet@pc4:~$ xinput --list | |
⎡ Virtual core pointer id=2 [master pointer (3)] | |
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] | |
⎜ ↳ SynPS/2 Synaptics TouchPad id=11 [slave pointer (2)] | |
⎣ Virtual core keyboard id=3 [master keyboard (2)] | |
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)] | |
↳ Power Button id=6 [slave keyboard (3)] | |
↳ Video Bus id=7 [slave keyboard (3)] | |
↳ Power Button id=8 [slave keyboard (3)] | |
↳ HP Truevision HD id=9 [slave keyboard (3)] | |
↳ AT Translated Set 2 keyboard id=10 [slave keyboard (3)] | |
↳ HP WMI hotkeys id=12 [slave keyboard (3)] | |
↳ HP Wireless hotkeys id=13 [slave keyboard (3)] | |
hostonnet@pc4:~$ | |
xinput command should be run as user that run the GUI (Ubuntu logged in user). | |
The one above list what we need is | |
↳ AT Translated Set 2 keyboard id=10 [slave keyboard (3)] | |
The ID is 10. | |
To disable the keyboard, run | |
xinput set-int-prop 10 "Device Enabled" 8 0 | |
To enable it, run | |
xinput set-int-prop 10 "Device Enabled" 8 1 | |
Method 2: Disabling on Boot | |
Edit file /etc/default/grub | |
vi /etc/default/grub | |
Find | |
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" | |
Replace it with | |
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash i8042.nokbd" | |
Regenerate grub.cfg with | |
update-grub2 | |
Reboot Laptop, Built in keyboard will be disabled by default. No need to run xinput command and manually disable each time. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I thank you sir. from the botom of my heart