WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: how to completely disable lid switch?  (Read 13875 times)

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1499
Re: how to completely disable lid switch?
« Reply #30 on: November 14, 2019, 11:10:52 AM »
I also enjoy this kind of quality time...much to my wife's chagrin ;)

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1499
Re: how to completely disable lid switch?
« Reply #31 on: November 17, 2019, 11:54:39 AM »
I heard back from the kernel guys, so here's a quick update.

Rich was right: If the kernel supports initcall_blacklist then the correct kernel boot parameter to disable the button driver is
Code: [Select]
initcall_blacklist=acpi_button_register_driver
If the kernel does not support initcall_blacklist, unbinding all of the button driver's devices has the same effect as disabling the driver. Here's how to find all the devices, unbind them, and confirm that they are unbound:

Code: [Select]
# ls /sys/bus/acpi/drivers/button
LNXPWRBN:00  PNP0C0D:00   PNP0C0E:00   bind         uevent       unbind
# echo "LNXPWRBN:00" > /sys/bus/acpi/drivers/button/unbind
# echo "PNP0C0D:00" > /sys/bus/acpi/drivers/button/unbind
# echo "PNP0C0E:00" > /sys/bus/acpi/drivers/button/unbind
# ls /sys/bus/acpi/drivers/button
bind    uevent  unbind

I've done the unbinding, but xscreensaver still refuses to kick in if lid is closed. I can only conclude that either a) there is a software component (X? kernel? video driver?) that can detect the sensor's state without the button driver's help or b) the T400 has a second lid sensor somewhere that does not depend on the button driver.
« Last Edit: November 17, 2019, 12:00:34 PM by GNUser »

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1499
Re: how to completely disable lid switch?
« Reply #32 on: November 18, 2019, 10:57:48 AM »
I am very close to a solution. I discovered that disabling the lid switch (via the unbind method above) is not enough to make the OS totally oblivious to the lid switch state because the touchpad generates noise while the laptop lid is closed.

Code: [Select]
$ cat /proc/bus/input/devices
---snip---
I: Bus=0011 Vendor=0002 Product=0007 Version=01b1
N: Name="SynPS/2 Synaptics TouchPad"
P: Phys=isa0060/serio1/input0
S: Sysfs=/devices/platform/i8042/serio1/input/input5
U: Uniq=
H: Handlers=mouse0 event5
B: PROP=1
B: EV=b
B: KEY=420 30000 0 0 0 0
B: ABS=11000003

I: Bus=0011 Vendor=0002 Product=000a Version=0000
N: Name="TPPS/2 IBM TrackPoint"
P: Phys=synaptics-pt/serio0/input0
S: Sysfs=/devices/platform/i8042/serio1/serio2/input/input7
U: Uniq=
H: Handlers=mouse1 event6
B: PROP=21
B: EV=7
B: KEY=70000 0 0 0 0
B: REL=3
---snip---

$ sudo cat /dev/input/event5 # close the lid without touching the touchpad, then open the lid and find:
 »Ò]ºö »Ò]ºö »Ò]èÛ
                      J »Ò]èÛ
                             ( »Ò]èÛ
                                       »Ò]èÛ
                                            % »Ò]èÛ
                                                    »Ò]èÛ
                                                         E »Ò]èÛ
---snip---

The noise apparently is enough to keep xscreensaver from kicking in while the lid is closed.

Disabling the touchpad using "xinput disable <touchpad's xinput id>" is not enough--I have to either disable the touchpad at the kernel level:
Code: [Select]
$ cd /sys/bus/serio/drivers/psmouse
$ echo serio1 | sudo tee unbind

Or else via xorg.conf:
Code: [Select]
# Xorg :1 -configure
# mkdir /etc/X11
# mv /root/xorg.conf.new /etc/X11/xorg.conf
# echo 'Section "InputClass"
    Identifier  "disable touchpad"
    MatchProduct "SynPS/2 Synaptics TouchPad"
    Option "Ignore" "on"
EndSection' >>/etc/X11/xorg.conf
$ echo "etc/X11/xorg.conf" >>/opt/.filetool.lst
$ filetool.sh -b
$ sudo reboot


Unbinding the lid switch PLUS disabling the touchpad using one of the two methods above causes all applications (including xscreensaver) to always behave as if the laptop lid were open. Yay! ;D

The only problem with using one of these methods to disable the touchpad (which I don't use anyway) is that they also disable the trackpoint (which I do use). It seems the trackpoint (/dev/input/event6) is somehow a child device of the touchpad (/dev/input/event5)?

*****
So here is my last question about this issue: Can you help me disable the touchpad (via driver unbinding or via xorg.conf) without also disabling the trackpoint?
*****
« Last Edit: November 18, 2019, 11:06:34 AM by GNUser »

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: how to completely disable lid switch?
« Reply #33 on: November 18, 2019, 01:21:51 PM »
https://wiki.archlinux.org/index.php/Lenovo_ThinkPad_T400
says you should add a device for /dev/input/mice to use the trackpad. Worth a try combining it with your ignore segment.
The only barriers that can stop you are the ones you create yourself.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11594
Re: how to completely disable lid switch?
« Reply #34 on: November 18, 2019, 01:36:50 PM »
Hi GNUser
Here's your touchpad:
S: Sysfs=/devices/platform/i8042/serio1/input/input5
Here's your trackpoint:
S: Sysfs=/devices/platform/i8042/serio1/serio2/input/input7
It's possible unbinding from  serio1  also killed the connection to  serio2.

Code: [Select]
$ cat /proc/bus/input/devices
$ sudo cat /dev/input/event5 # close the lid without touching the touchpad, then open the lid and find:
 »Ò]ºö »Ò]ºö »Ò]èÛ
                      J »Ò]èÛ
                             ( »Ò]èÛ
                                       »Ò]èÛ
                                            % »Ò]èÛ
                                                    »Ò]èÛ
                                                         E »Ò]èÛ
---snip---
You should repeat that test with  /dev/input/event6  to make sure it's not noisy too.

I have a laptop that I rarely use because I hate laptops. Anyway, last May I finally found out how to disable that annoying touchpad
that would do things every time I accidentally bumped it with the heel of my hand. I don't recall the details (hows and whys) but I
think I tracked down all the changes involved.

.xsession provides an entry for launching something called  .mouse_config:
Code: [Select]
/usr/local/bin/Xorg -nolisten tcp &
export XPID=$!
waitforX || ! echo failed in waitforX || exit
"$DESKTOP" 2>/tmp/wm_errors &
export WM_PID=$!
[ -x ./.setbackground ] && ./.setbackground
[ -x ./.mouse_config ] && ./.mouse_config &
[ $(which "$ICONS".sh) ] && ${ICONS}.sh &
[ -d ".X.d" ] && find ".X.d" -type f -print | while read F; do . "$F"; done

This is the contents of my  .mouse_config:
Code: [Select]
xset m 3/1 0
xmodmap -e 'pointer = 1 2 3 4 5'

This is my  /etc/X11/xorg.conf:
Code: [Select]
Section "ServerLayout"
Identifier     "X.org Configured"
Screen      0  "Screen0" 0 0
Screen      1  "Screen1" RightOf "Screen0"
Screen      2  "Screen2" RightOf "Screen1"
InputDevice    "Mouse0" "CorePointer"
InputDevice    "Mouse1"
InputDevice    "Keyboard0" "CoreKeyboard"
Option "AllowEmptyInput" "off"
EndSection

Section "Files"
ModulePath   "/usr/local/lib/X11/modules"
FontPath     "/usr/lib/X11/fonts/misc/"
FontPath     "/usr/lib/X11/fonts/TTF/"
FontPath     "/usr/lib/X11/fonts/OTF/"
FontPath     "/usr/lib/X11/fonts/Type1/"
FontPath     "/usr/lib/X11/fonts/100dpi/"
FontPath     "/usr/lib/X11/fonts/75dpi/"
EndSection

Section "Module"
Load  "record"
Load  "glx"
Load  "extmod"
Load  "dri2"
Load  "dri"
Load  "dbe"
EndSection

Section "InputDevice"
Identifier  "Keyboard0"
Driver      "kbd"
EndSection

Section "InputDevice"
Identifier  "Mouse0"
Driver      "mouse"
Option     "Protocol" "auto"
Option     "Device" "/dev/input/mice"
Option     "ZAxisMapping" "4 5 6 7"
EndSection

Section "InputDevice"
Identifier  "Mouse1"
Driver      "synaptics"
Option     "TouchpadOff" "1"
EndSection

Section "Monitor"
Identifier   "Monitor0"
VendorName   "Monitor Vendor"
ModelName    "Monitor Model"
EndSection

Section "Monitor"
Identifier   "Monitor1"
VendorName   "Monitor Vendor"
ModelName    "Monitor Model"
EndSection

Section "Monitor"
Identifier   "Monitor2"
VendorName   "Monitor Vendor"
ModelName    "Monitor Model"
EndSection

Section "Device"
        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
        ### <percent>: "<f>%"
        ### [arg]: arg optional
        #Option     "NoAccel"            # [<bool>]
        #Option     "SWcursor"            # [<bool>]
        #Option     "Dac6Bit"            # [<bool>]
        #Option     "Dac8Bit"            # [<bool>]
        #Option     "BusType"            # [<str>]
        #Option     "CPPIOMode"          # [<bool>]
        #Option     "CPusecTimeout"      # <i>
        #Option     "AGPMode"            # <i>
        #Option     "AGPFastWrite"        # [<bool>]
        #Option     "AGPSize"            # <i>
        #Option     "GARTSize"            # <i>
        #Option     "RingSize"            # <i>
        #Option     "BufferSize"          # <i>
        #Option     "EnableDepthMoves"    # [<bool>]
        #Option     "EnablePageFlip"      # [<bool>]
        #Option     "NoBackBuffer"        # [<bool>]
        #Option     "DMAForXv"            # [<bool>]
        #Option     "FBTexPercent"        # <i>
        #Option     "DepthBits"          # <i>
        #Option     "PCIAPERSize"        # <i>
        #Option     "AccelDFS"            # [<bool>]
        #Option     "IgnoreEDID"          # [<bool>]
        #Option     "CustomEDID"          # [<str>]
        #Option     "DisplayPriority"    # [<str>]
        #Option     "PanelSize"          # [<str>]
        #Option     "ForceMinDotClock"    # <freq>
        #Option     "ColorTiling"        # [<bool>]
        #Option     "VideoKey"            # <i>
        #Option     "RageTheatreCrystal" # <i>
        #Option     "RageTheatreTunerPort" # <i>
        #Option     "RageTheatreCompositePort" # <i>
        #Option     "RageTheatreSVideoPort" # <i>
        #Option     "TunerType"          # <i>
        #Option     "RageTheatreMicrocPath" # <str>
        #Option     "RageTheatreMicrocType" # <str>
        #Option     "ScalerWidth"        # <i>
        #Option     "RenderAccel"        # [<bool>]
        #Option     "SubPixelOrder"      # [<str>]
        #Option     "ClockGating"        # [<bool>]
        #Option     "VGAAccess"          # [<bool>]
        #Option     "ReverseDDC"          # [<bool>]
        #Option     "LVDSProbePLL"        # [<bool>]
        #Option     "AccelMethod"        # <str>
        #Option     "DRI"                # [<bool>]
        #Option     "ConnectorTable"      # <str>
        #Option     "DefaultConnectorTable" # [<bool>]
        #Option     "DefaultTMDSPLL"      # [<bool>]
        #Option     "TVDACLoadDetect"    # [<bool>]
        #Option     "ForceTVOut"          # [<bool>]
        #Option     "TVStandard"          # <str>
        #Option     "IgnoreLidStatus"    # [<bool>]
        #Option     "DefaultTVDACAdj"    # [<bool>]
        #Option     "Int10"              # [<bool>]
        #Option     "EXAVSync"            # [<bool>]
        #Option     "ATOMTVOut"          # [<bool>]
        #Option     "R4xxATOM"            # [<bool>]
        #Option     "ForceLowPowerMode"  # [<bool>]
        #Option     "DynamicPM"          # [<bool>]
        #Option     "NewPLL"              # [<bool>]
        #Option     "ZaphodHeads"        # <str>
Identifier  "Card0"
Driver      "radeon"
BusID       "PCI:1:5:0"
EndSection

Section "Device"
        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
        ### <percent>: "<f>%"
        ### [arg]: arg optional
        #Option     "ShadowFB"            # [<bool>]
        #Option     "Rotate"              # <str>
        #Option     "fbdev"              # <str>
        #Option     "debug"              # [<bool>]
Identifier  "Card1"
Driver      "fbdev"
BusID       "PCI:1:5:0"
EndSection

Section "Device"
        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
        ### <percent>: "<f>%"
        ### [arg]: arg optional
        #Option     "ShadowFB"            # [<bool>]
        #Option     "DefaultRefresh"      # [<bool>]
        #Option     "ModeSetClearScreen" # [<bool>]
Identifier  "Card2"
Driver      "vesa"
BusID       "PCI:1:5:0"
EndSection

Section "Screen"
Identifier "Screen0"
Device     "Card0"
Monitor    "Monitor0"
SubSection "Display"
Viewport   0 0
Depth     1
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     4
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     8
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     15
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     16
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     24
EndSubSection
EndSection

Section "Screen"
Identifier "Screen1"
Device     "Card1"
Monitor    "Monitor1"
SubSection "Display"
Viewport   0 0
Depth     1
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     4
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     8
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     15
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     16
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     24
EndSubSection
EndSection

Section "Screen"
Identifier "Screen2"
Device     "Card2"
Monitor    "Monitor2"
SubSection "Display"
Viewport   0 0
Depth     1
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     4
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     8
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     15
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     16
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     24
EndSubSection
EndSection

I also have  /etc/X11/xorg.conf.d/50-synaptics.conf  file. I'm not sure it actually gets used. You're welcome to dig through the
attached Xorg.0.log file to see if it is:
Code: [Select]
# Example xorg.conf.d snippet that assigns the touchpad driver
# to all touchpads. See xorg.conf.d(5) for more information on
# InputClass.
# DO NOT EDIT THIS FILE, your distribution will likely overwrite
# it when updating. Copy (and rename) this file into
# /etc/X11/xorg.conf.d first.
# Additional options may be added in the form of
#   Option "OptionName" "value"
#
Section "InputClass"
        Identifier "touchpad catchall"
        Driver "synaptics"
        MatchIsTouchpad "on"
Option "TouchpadOff" "1"
# This option is recommend on all Linux systems using evdev, but cannot be
# enabled by default. See the following link for details:
# http://who-t.blogspot.com/2010/11/how-to-ignore-configuration-errors.html
#       MatchDevicePath "/dev/input/event*"
EndSection

Section "InputClass"
        Identifier "touchpad ignore duplicates"
        MatchIsTouchpad "on"
        MatchOS "Linux"
        MatchDevicePath "/dev/input/mouse1"
        Option "Ignore" "on"
Option "TouchpadOff" "1"
EndSection

And a copy of  /proc/bus/input/devices  so you can see what's assigned to where:
Code: [Select]
I: Bus=0019 Vendor=0000 Product=0001 Version=0000
N: Name="Power Button"
P: Phys=PNP0C0C/button/input0
S: Sysfs=/devices/LNXSYSTM:00/device:00/PNP0C0C:00/input/input0
U: Uniq=
H: Handlers=kbd event0
B: PROP=0
B: EV=3
B: KEY=100000 0 0 0

I: Bus=0019 Vendor=0000 Product=0005 Version=0000
N: Name="Lid Switch"
P: Phys=PNP0C0D/button/input0
S: Sysfs=/devices/LNXSYSTM:00/device:00/PNP0C0D:00/input/input1
U: Uniq=
H: Handlers=event1
B: PROP=0
B: EV=21
B: SW=1

I: Bus=0019 Vendor=0000 Product=0001 Version=0000
N: Name="Power Button"
P: Phys=LNXPWRBN/button/input0
S: Sysfs=/devices/LNXSYSTM:00/LNXPWRBN:00/input/input2
U: Uniq=
H: Handlers=kbd event2
B: PROP=0
B: EV=3
B: KEY=100000 0 0 0

I: Bus=0011 Vendor=0001 Product=0001 Version=ab41
N: Name="AT Translated Set 2 keyboard"
P: Phys=isa0060/serio0/input0
S: Sysfs=/devices/platform/i8042/serio0/input/input3
U: Uniq=
H: Handlers=sysrq kbd event3
B: PROP=0
B: EV=120013
B: KEY=4 2000000 3803078 f800d001 feffffdf ffefffff ffffffff fffffffe
B: MSC=10
B: LED=7

I: Bus=0010 Vendor=001f Product=0001 Version=0100
N: Name="PC Speaker"
P: Phys=isa0061/input0
S: Sysfs=/devices/platform/pcspkr/input/input4
U: Uniq=
H: Handlers=kbd event4
B: PROP=0
B: EV=40001
B: SND=6

I: Bus=0019 Vendor=0000 Product=0006 Version=0000
N: Name="Video Bus"
P: Phys=LNXVIDEO/video/input0
S: Sysfs=/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:01/LNXVIDEO:00/input/input5
U: Uniq=
H: Handlers=kbd event5
B: PROP=0
B: EV=3
B: KEY=3e000b 0 0 0 0 0 0 0

I: Bus=0019 Vendor=0000 Product=0000 Version=0000
N: Name="HP WMI hotkeys"
P: Phys=wmi/input0
S: Sysfs=/devices/virtual/input/input6
U: Uniq=
H: Handlers=kbd event6
B: PROP=0
B: EV=33
B: KEY=40 0 0 0 10007 0 0 2100400 0 0 0 0
B: MSC=10
B: SW=22

I: Bus=0003 Vendor=046d Product=c52f Version=0111
N: Name="Logitech USB Receiver"
P: Phys=usb-0000:00:13.0-1/input0
S: Sysfs=/devices/pci0000:00/0000:00:13.0/usb5/5-1/5-1:1.0/input/input7
U: Uniq=
H: Handlers=mouse0 event7
B: PROP=0
B: EV=17
B: KEY=ffff0000 0 0 0 0 0 0 0 0
B: REL=143
B: MSC=10

I: Bus=0003 Vendor=046d Product=c52f Version=0111
N: Name="Logitech USB Receiver"
P: Phys=usb-0000:00:13.0-1/input1
S: Sysfs=/devices/pci0000:00/0000:00:13.0/usb5/5-1/5-1:1.1/input/input8
U: Uniq=
H: Handlers=kbd event8
B: PROP=0
B: EV=1f
B: KEY=4837fff 72ff32d bf544446 0 0 1 20f90 8b17c000 677bfa d9415fed 9ed680 4400 0 10000002
B: REL=40
B: ABS=1 0
B: MSC=10

I: Bus=0011 Vendor=0002 Product=0007 Version=01b1
N: Name="SynPS/2 Synaptics TouchPad"
P: Phys=isa0060/serio1/input0
S: Sysfs=/devices/platform/i8042/serio1/input/input9
U: Uniq=
H: Handlers=mouse1 event9
B: PROP=9
B: EV=b
B: KEY=6420 0 30000 0 0 0 0 0 0 0 0
B: ABS=2608000 11000003

I: Bus=0003 Vendor=064e Product=f203 Version=0421
N: Name="HP Webcam-101"
P: Phys=usb-0000:00:12.2-3/button
S: Sysfs=/devices/pci0000:00/0000:00:12.2/usb1/1-3/1-3:1.0/input/input10
U: Uniq=
H: Handlers=kbd event10
B: PROP=0
B: EV=3
B: KEY=100000 0 0 0 0 0 0

I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="HDA ATI SB Mic"
P: Phys=ALSA
S: Sysfs=/devices/pci0000:00/0000:00:14.2/sound/card0/input11
U: Uniq=
H: Handlers=event11
B: PROP=0
B: EV=21
B: SW=10

I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="HDA ATI SB Headphone"
P: Phys=ALSA
S: Sysfs=/devices/pci0000:00/0000:00:14.2/sound/card0/input12
U: Uniq=
H: Handlers=event12
B: PROP=0
B: EV=21
B: SW=4

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1499
Re: how to completely disable lid switch?
« Reply #35 on: November 18, 2019, 02:04:15 PM »
You should repeat that test with  /dev/input/event6  to make sure it's not noisy too.

Good idea. I did, and can confirm no noise from event6 (trackpoint). The touchpad is the only fly in the ointment.

BTW I was mistaken in my prior post--disabling touchpad via xorg.conf doesn't actually help. Only the unbind serio1 does the trick.

I tried to avoid unbinding serio1 and, instead, using this command to discard the noise that the touchpad generates (note: evtest not currently in the repository)...
Code: [Select]
$ evtest --grab /dev/input/event5 >/dev/null 2>&1...but, interestingly, discarding the noise doesn't help. If the touchpad makes any noise--even if noise is discarded--it prevents xscreensaver from kicking in.

Only this command actually prevents the touchpad from getting in my way:

Code: [Select]
$ cd /sys/bus/serio/drivers/psmouse
$ echo serio1 | sudo tee unbind

It's possible unbinding from  serio1  also killed the connection to  serio2.

Well worded. Yes, I think this is exactly what it has come down to. I'm stuck here. I need to unbind the touchpad, but the trackpoint/"nipple mouse" (serio2) needs to remain operational.
« Last Edit: November 18, 2019, 02:05:57 PM by GNUser »

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1499
Re: how to completely disable lid switch?
« Reply #36 on: November 18, 2019, 02:37:21 PM »
Yes, Rich, you are correct as usual. Unbinding serio1 causes serio2 to be unbound as well :'(

Code: [Select]
$ sudo su
# cd /sys/bus/serio/drivers/psmouse
# ls
bind         description  serio1       uevent
bind_mode    module       serio2       unbind
# echo serio1 >unbind
# ls
bind         description  uevent
bind_mode    module       unbind

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1499
Re: how to completely disable lid switch?
« Reply #37 on: November 18, 2019, 02:41:00 PM »
Maybe unbinding serio1 is more than what I need? Maybe there is a way to somehow disable things in the udev tree up to and including input5 (i.e., disable event5 and input5), while leaving serio1 alone?

Code: [Select]
# udevadm info --attribute-walk --name=/dev/input/event5

Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/platform/i8042/serio1/input/input5/event5':
    KERNEL=="event5"
    SUBSYSTEM=="input"
    DRIVER==""

  looking at parent device '/devices/platform/i8042/serio1/input/input5':
    KERNELS=="input5"
    SUBSYSTEMS=="input"
    DRIVERS==""
    ATTRS{uniq}==""
    ATTRS{properties}=="1"
    ATTRS{phys}=="isa0060/serio1/input0"
    ATTRS{name}=="SynPS/2 Synaptics TouchPad"

  looking at parent device '/devices/platform/i8042/serio1':
    KERNELS=="serio1"
    SUBSYSTEMS=="serio"
    DRIVERS=="psmouse"
    ATTRS{resetafter}=="5"
    ATTRS{resolution}=="200"
    ATTRS{description}=="i8042 AUX port"
    ATTRS{firmware_id}=="PNP: PNP0f13"
    ATTRS{protocol}=="SynPS/2"
    ATTRS{rate}=="80"
    ATTRS{bind_mode}=="auto"
    ATTRS{resync_time}=="0"

  looking at parent device '/devices/platform/i8042':
    KERNELS=="i8042"
    SUBSYSTEMS=="platform"
    DRIVERS=="i8042"
    ATTRS{driver_override}=="(null)"

  looking at parent device '/devices/platform':
    KERNELS=="platform"
    SUBSYSTEMS==""
    DRIVERS==""

I'm terrible at writing udev rules. Am I on the right track?
« Last Edit: November 18, 2019, 02:45:10 PM by GNUser »

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1499
Re: how to completely disable lid switch?
« Reply #38 on: November 18, 2019, 03:00:01 PM »
It was just a shot in the dark, but I tried to create this /etc/udev/rules.d/10-disable-touchpad.rules then include it in mydata.tgz and reboot:
Code: [Select]
ACTION=="add", SUBSYSTEM=="input", ATTR{phys}=="isa0060/serio1/input0", OPTIONS="ignore_device"It had no effect (which is not surprising given that I am an utter noobie when it comes to udev).

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1499
Re: how to completely disable lid switch?
« Reply #39 on: November 19, 2019, 11:36:03 AM »
SOLVED! ;D ;D ;D ;D ;D ;D ;D ;D

1. Disable lid switch by unbinding its driver:
Code: [Select]
# echo "PNP0C0D:00" >/sys/bus/acpi/drivers/button/unbind
# echo "PNP0C0E:00" >/sys/bus/acpi/drivers/button/unbind

2. Disable touchpad by unplugging its ribbon (the ribbon is just under the palmrest--it was trivial to find and disconnect)

Now all applications (including xscreensaver) behave identically regardless of whether laptop lid is open or closed. The trackpoint and its three buttons (just under the spacebar) are fully operational.

(It's odd that the trackpoint is always a child of the touchpad on software level, even though on hardware level the two are independent. Oh, well.)


Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11594
Re: how to completely disable lid switch?
« Reply #40 on: November 21, 2019, 11:09:17 AM »
Hi GNUser
I know it's late in the game, but I stumbled upon this:
https://www.x.org/releases/current/doc/man/man4/void.4.xhtml
It's an Xorg  void  input driver that basically does nothing. You could change your touchpads InputDevice section
From:
Code: [Select]
Driver      "synaptics"To:
Code: [Select]
Driver      "void"The caveat is the driver is not in the repository so you would need to compile it yourself.

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1499
Re: how to completely disable lid switch?
« Reply #41 on: November 21, 2019, 11:25:13 AM »
Interesting. I'll try it when I get a chance. Thank you!

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1499
Re: how to completely disable lid switch?
« Reply #42 on: December 17, 2019, 02:25:30 PM »
Even after running the commands in Reply #39, if I suspend my laptop with
Code: [Select]
sudo sh -c "echo mem >/sys/power/state"
then close the lid then open the lid, something causes the laptop to wake from suspend! So the lid switch is not completely dead yet :o

It turns out that even after lid switch is unbinded from the button driver, acpi can still detect the lid switch state and cause the laptop to wake up from suspend when the lid is opened. cat /proc/acpi/wakeup confirms this. Maybe the issue is that I'm running the commands that unbind the lid switch from the button driver after acpi has already detected the lid switch...

So the (hopefully) final solution is to do the things in Reply #39 plus run this command, which toggles LID's wakup status:
Code: [Select]
sudo sh -c 'echo LID >/proc/acpi/wakeup'
(Let's see how long it takes to me to truly, fully, completely kill the lid switch...)