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.
Linux
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:
-
Stay on topic: Posts and discussions should be related to Linux, open source software, and related technologies.
-
Be respectful: Treat fellow community members with respect and courtesy.
-
Quality over quantity: Share informative and thought-provoking content.
-
No spam or self-promotion: Avoid excessive self-promotion or spamming.
-
No NSFW adult content
-
Follow general lemmy guidelines.
My laptop didn't have a key for that, so I ended up gluing together this universal Linux solution.
This post is titled badly. Its worded like a question but its actually a blog post that contains the answer. Weird.
It's perfectly titled. "How to" is a statement, a question is "how do I...?"
Yup, udev is the right tool for this. I'd just put the script in /usr/local/bin, where it belongs.
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.
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.
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.