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?

    • frongt@lemmy.zip
      link
      fedilink
      English
      arrow-up
      6
      ·
      7 days ago

      It’s perfectly titled. “How to” is a statement, a question is “how do I…?”

  • lambalicious@lemmy.sdf.org
    link
    fedilink
    English
    arrow-up
    3
    ·
    7 days ago

    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.nlOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      4 days ago

      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
        link
        fedilink
        English
        arrow-up
        2
        ·
        4 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.

  • rhythmisaprancer@piefed.social
    link
    fedilink
    English
    arrow-up
    9
    ·
    7 days ago

    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.nlOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      4 days ago

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

  • Avid Amoeba@lemmy.ca
    link
    fedilink
    English
    arrow-up
    5
    ·
    edit-2
    7 days ago

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