Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save programmerShinobi/f2b8f10e3f02697e7ca13726a2e7ec2a to your computer and use it in GitHub Desktop.

Select an option

Save programmerShinobi/f2b8f10e3f02697e7ca13726a2e7ec2a to your computer and use it in GitHub Desktop.
Disable Internal Keyboard & Touchpad Permanently on elementary OS

Disable Internal Keyboard & Touchpad Permanently on elementary OS

Tested on: elementary OS (Ubuntu Noble base, Wayland session) Purpose: Permanently disable the laptop's built-in keyboard, touchpad, and trackpoint so that only external USB keyboard & mouse are used — even after reboot.


⚠️ Important Warnings — Read First

  1. Connect your external USB keyboard and mouse BEFORE starting. If you disable the internal keyboard without a working external one, you will be locked out of your own laptop.

  2. Do NOT disable system hotkey devices such as:

    • Video Bus
    • Power Button
    • Sleep Button
    • Lid Switch
    • Dell WMI hotkeys

    These control brightness, volume, power, and lid behavior. Disabling them may break essential laptop functions.

  3. You will need sudo access. Make sure you know your password.

  4. This guide uses udev rules, which is the correct method for Wayland sessions (elementary OS default). Do not use xinput — it only affects XWayland and will not persist.


📋 Step-by-Step Instructions

Step 1 — Plug in External Keyboard & Mouse

Verify both are working before continuing.

lsusb

You should see your external keyboard and mouse listed.


Step 2 — Install libinput-tools

This tool lists real hardware devices (not XWayland virtual devices).

sudo apt update
sudo apt install -y libinput-tools

Step 3 — Identify Internal Device Names

sudo libinput list-devices

Look for the internal keyboard and touchpad. On a typical Dell laptop, you will see entries like:

Device Role
AT Translated Set 2 keyboard Internal keyboard
AlpsPS/2 ALPS DualPoint TouchPad Internal touchpad
AlpsPS/2 ALPS DualPoint Stick Trackpoint (center stick)

📝 Write down the exact names. They are case-sensitive and must match exactly.


Step 4 — Create the udev Rule File

sudo nano /etc/udev/rules.d/99-disable-internal-input.rules

Paste the following content. Replace the device names if your hardware differs.

# Disable internal laptop keyboard
ACTION=="add|change", ATTRS{name}=="AT Translated Set 2 keyboard", ENV{LIBINPUT_IGNORE_DEVICE}="1"

# Disable internal touchpad
ACTION=="add|change", ATTRS{name}=="AlpsPS/2 ALPS DualPoint TouchPad", ENV{LIBINPUT_IGNORE_DEVICE}="1"

# Disable internal trackpoint (center stick)
ACTION=="add|change", ATTRS{name}=="AlpsPS/2 ALPS DualPoint Stick", ENV{LIBINPUT_IGNORE_DEVICE}="1"

Save the file:

  • Ctrl + O → Enter (write)
  • Ctrl + X (exit)

Step 5 — Reload udev Rules

sudo udevadm control --reload-rules
sudo udevadm trigger

Step 6 — Reboot

sudo reboot

Step 7 — Verify After Reboot

Log in using your external keyboard and mouse, then run:

sudo libinput list-devices | grep -E "^Device:"

✅ Expected result: The internal keyboard, touchpad, and trackpoint should be absent from the list. Only external devices and system hotkeys should appear.

Example of a correct output:

Device:           USB Gaming Mouse
Device:           USB Gaming Mouse
Device:           USB Gaming Mouse Consumer Control
Device:           SEMICO   USB Gaming Keyboard
Device:           SEMICO   USB Gaming Keyboard  Consumer Control
Device:           SEMICO   USB Gaming Keyboard  System Control
Device:           SEMICO   USB Gaming Keyboard  Keyboard
Device:           Video Bus
Device:           Power Button
Device:           Power Button
Device:           Lid Switch
Device:           Sleep Button
Device:           Dell WMI hotkeys

If the internal devices are gone → setup is successful and permanent. 🎉


🔄 How to Revert (Re-enable Internal Input)

If you ever need to restore the built-in keyboard and touchpad:

sudo rm /etc/udev/rules.d/99-disable-internal-input.rules
sudo reboot

Everything will return to normal after reboot.


🛠️ Temporary Toggle (Without Reboot)

To temporarily re-enable a device without deleting the rule:

  1. Edit the rule file:
    sudo nano /etc/udev/rules.d/99-disable-internal-input.rules
  2. Comment out the lines you want to re-enable by adding # at the start.
  3. Reload:
    sudo udevadm control --reload-rules
    sudo udevadm trigger

📌 Quick Reference Cheat Sheet

Task Command
List all input devices sudo libinput list-devices
List device names only sudo libinput list-devices | grep -E "^Device:"
Edit rule file sudo nano /etc/udev/rules.d/99-disable-internal-input.rules
Reload udev rules sudo udevadm control --reload-rules && sudo udevadm trigger
Remove rule (revert) sudo rm /etc/udev/rules.d/99-disable-internal-input.rules
Reboot sudo reboot

🧠 Why This Works

  • elementary OS runs a Wayland session by default.
  • xinput only controls XWayland virtual devices — changes do not persist and do not affect the real hardware.
  • libinput is the actual input driver used by Wayland.
  • The environment variable LIBINPUT_IGNORE_DEVICE=1 tells libinput to completely ignore a device at the driver level — before the desktop even sees it.
  • Because it's a udev rule, it is applied on every boot automatically → permanent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment