Disable Laptop Lid Button in Debian Based Linux
For all of my time using linux, I could use ACPID to change what happens when I close the lid on my laptop.
Or I could use a number of Power Mangers like
But as of 2022 I could not for the life of me figure this one out. I searched all over the internet for a hole like 4 hours, reading any forum that came close, reading man pages and uninstalling anything that had to do with power and buttons.
Long Story Short
sudo modprobe --remove button
Long Story Long
The closet post I could find of someone with the same issue is here, and it doesn’t look like they ever figured it out. I wrote custom acpid rules, I uninstalled acpid and acpi and a bunch of stuff. I found
/proc/acpi/buttons/lid/LID0/state and then I found
/sys/module/button/lid_init*. That is when something clicked, the word __module__ seemed familiar. Oh yeah kernel modules. So yeah that is pretty much how I figured that out.
Also from this post, i just found you can stop this from
/etc/systemd/logind.conf along with some other settings.