this post was submitted on 02 Jan 2026
38 points (100.0% liked)

Linux

14752 readers
94 users here now

Welcome to c/linux!

Welcome to our thriving Linux community! Whether you're a seasoned Linux enthusiast or just starting your journey, we're excited to have you here. Explore, learn, and collaborate with like-minded individuals who share a passion for open-source software and the endless possibilities it offers. Together, let's dive into the world of Linux and embrace the power of freedom, customization, and innovation. Enjoy your stay and feel free to join the vibrant discussions that await you!

Rules:

  1. Stay on topic: Posts and discussions should be related to Linux, open source software, and related technologies.

  2. Be respectful: Treat fellow community members with respect and courtesy.

  3. Quality over quantity: Share informative and thought-provoking content.

  4. No spam or self-promotion: Avoid excessive self-promotion or spamming.

  5. No NSFW adult content

  6. Follow general lemmy guidelines.

founded 2 years ago
MODERATORS
 

cross-posted from: https://feddit.nl/post/49130941

How to disable Linux laptop keyboard when custom keyboard is plugged in

How are you guys doing this? Are you using Sway or Hyprland for this? Anyone else using udev already?

top 8 comments
sorted by: hot top controversial new old
[–] rhythmisaprancer@piefed.social 8 points 6 days ago (1 children)

I have never plugged a keyboard into my Linux laptop, but it does have a function key to turn the keyboard off. So did my last one. I use a windows laptop for work and that keyboard does not turn off when an external keyboard is plugged in FWIW.

[–] fhoekstra@feddit.nl 1 points 3 days ago

My laptop didn't have a key for that, so I ended up gluing together this universal Linux solution.

[–] unexposedhazard@discuss.tchncs.de 4 points 6 days ago (1 children)

This post is titled badly. Its worded like a question but its actually a blog post that contains the answer. Weird.

[–] frongt@lemmy.zip 6 points 6 days ago

It's perfectly titled. "How to" is a statement, a question is "how do I...?"

[–] avidamoeba@lemmy.ca 4 points 6 days ago* (last edited 6 days ago)

Yup, udev is the right tool for this. I'd just put the script in /usr/local/bin, where it belongs.

[–] lambalicious@lemmy.sdf.org 3 points 6 days ago (1 children)

I assume one of the reasons to fully disable the internal keyboard is that the external one is sitting on top, so this setup is for when you are short of space? (eg.: lap carrying your laptop, note: don't do that!)

Tho, someone correct me if this is not the case, this way, ¿you would also lose access to the special hardware key functions of the keyboard (eg.: AURA mode, fan speed, rfkill on ASUS laptops, etc), right?

Defo this is one of the nice thigns I like udev rules for - taking action when specific hardware is plugged or unplugged, thus making the mechanical task of connecting and configuring hardware lots more ergonomic.

[–] fhoekstra@feddit.nl 2 points 3 days ago (1 children)

My ASUS laptop special buttons above the normal keyboard are registered as a separate device to the kernel, so this does not impact them. They are far enough out of the way to not get pressed by my ergo split though.

[–] lambalicious@lemmy.sdf.org 2 points 3 days ago

Excellent! Hadn't really thought that one keyboard can be multiple devices, but then again, those are also keyboard-touchpad combos, should have expected something like that.