DEV Community

Cover image for Disable Laptop's Built-in Keyboard Permanently on Manjaro Linux
Shawon Saha
Shawon Saha

Posted on

Disable Laptop's Built-in Keyboard Permanently on Manjaro Linux

At first you need to install a program called xinput

Open your terminal by hitting ctrl+alt+t and run the command below

sudo pacman -S xorg-xinput
Enter fullscreen mode Exit fullscreen mode

After installing xinput successfully. Run the command below to find the keyboard ID

xinput list
Enter fullscreen mode Exit fullscreen mode

xinput list
Now find AT Translated Set 2 keyboard and ID associated with it from the list. In my case it is 18

Now if you run

xinput float <your keyboar ID>
Enter fullscreen mode Exit fullscreen mode

or

xinput disable "AT Translated Set 2 keyboard"
Enter fullscreen mode Exit fullscreen mode

you'll notice your keyboard isn't working anymore. But this fix is temporary. If you restart the machine the keyboard will work again.

If your built-in keyboard is faulty and you don't want to use that keyboard anymore. Rather you wanna use an external keyboard then you need to disable that keyboard permanently.

In linux machine you need to run the above command every time you reboot the system.

To automate this in Manjaro Linux / KDE Plasma you have to set a startup shell script which will run at every startup.

At first open your terminal and create a shell script in your Documents folder

cd Documents/ && touch disable_keyboard.sh && nano disable_keyboard.sh
Enter fullscreen mode Exit fullscreen mode

After running the above command you'll see a screen like this in terminal
nano text editor

Paste this by pressing ctrl+shift+v

#!/bin/bash
xinput disable "AT Translated Set 2 keyboard"
Enter fullscreen mode Exit fullscreen mode

Then save the file and Exit nano (ctrl + o enter ctrl + x)

Now you'll have to make that file executable by running.

chmod +x disable_keyboard.sh
Enter fullscreen mode Exit fullscreen mode

Then Goto System Settings > Startup and Shutdown > Autostart
At the bottom you'll see a + Add... > + Add Login Script... and browse disable_keyboard.sh from /Documents

KDE Plasma Settings for Startup Applications

You are all set. Now restart your machine... :)

Top comments (0)