General TC > General TC Talk

how to completely disable lid switch?

(1/9) > >>

GNUser:
I run Pure64 10.1 on my laptop. I'd like the laptop's behavior to be identical regardless of whether its lid is open or closed. In the past, I found that the only way to achieve completely identical behavior is to disable the lid switch at the level of the kernel.

In Debian, I can find the lid's sysfs node (e.g., PNP0C0D:00) by running cat /proc/acpi/wakeup, then this command completely disables the lid switch by unbinding its driver:

--- Code: ---echo 'PNP0C0D:00' | sudo tee /sys/bus/acpi/drivers/button/unbind
--- End code ---
In Pure64, cat /proc/acpi/wakeup shows me that laptop lid's sysfs node is PNP0C0D:00 as expected, but notice what happens when I try to unbind the driver:

--- Code: ---echo 'PNP0C0D:00' | sudo tee /sys/bus/acpi/drivers/button/unbind
PNP0C0D:00
tee: /sys/bus/acpi/drivers/button/unbind: I/O error

--- End code ---
Can you please help me completely disable the lid switch? I'm aware of the acpi=off kernel boot parameter, but that has the unpleasant side effect of also disabling kernel's battery stats (which I need for one of my shell scripts). I'd like to disable only the lid switch.

Rich:
Hi GNUser
I see  laptop-mode-tools.tcz  includes:

--- Code: ---/usr/local/share/laptop-mode-tools/files/acpi/actions/lm_lid.sh
/usr/local/share/laptop-mode-tools/files/acpi/events/lm_lid
--- End code ---
Maybe they are of some use?

GNUser:
Hi, Rich. acpitool (not currently in repo) gets me part of the way there:


--- Code: ---$ acpitool -w
   Device S-state   Status   Sysfs node
  ---------------------------------------
  1. HDEF   S4 *disabled  pci:0000:00:1b.0
  2. USB1   S4 *enabled   pci:0000:00:1d.0
---snip---
  17. LID   S3 *enabled   platform:PNP0C0D:00
$ sudo acpitool -W 17
  Changed status for wakeup device #17 (LID)

   Device S-state   Status   Sysfs node
  ---------------------------------------
  1. HDEF   S4 *disabled  pci:0000:00:1b.0
  2. USB1   S4 *enabled   pci:0000:00:1d.0
---snip---
  17. LID   S3 *disabled  platform:PNP0C0D:00

--- End code ---

However, even after the above, if laptop lid is closed then xscreensaver does not kick in after the appropriate number of minutes. So disabling the lid switch under acpi is not the whole story.

Any idea how to completely disable the lid switch via software (or at least make xscreensaver unaware of it)?

GNUser:
acpi is a red herring. Even if it is completely disabled with acpi=off kernel boot parameter, xscreensaver still refuses to kick in while laptop lid is closed.

xscreensaver must be aware of the lid switch some other way (BIOS? kernel? Xorg?). I'll contact the xscreensaver developer to see if he can point me in the right direction.



Rich:
Hi GNUser
I'm not sure I'm following you. Are you saying the display won't blank with the lid closed?

Navigation

[0] Message Index

[#] Next page

Go to full version