FW16 wakeup triggers - how to disable them while in a backpack

For those interested, I have disabled the keyboard, trackpad and lid open from triggering an exit from suspend. So it survives better in a backpack. Pressing the power button exists suspend.
The latest Linux kernel 7.0.0 changes where the lid open wakeup control file is.
So, here is a new version of the wakeup script, with the disabled lid open wakeup added.

#!/bin/sh
# This file should be placed in: /usr/lib/systemd/system-sleep

PATH=/sbin:/usr/sbin:/bin:/usr/bin

case "$1" in
	pre)	#echo AMDI0010:03 >/sys/bus/platform/drivers/i2c_designware/unbind
		#echo 1-4 >/sys/bus/usb/drivers/usb/unbind
		/home/jcd/computer/framework/qmk_hid/target/debug/qmk_hid via --backlight 0
		echo disabled > /sys/devices/pci0000:00/0000:00:08.1/0000:c1:00.3/usb1/1-4/1-4.3/power/wakeup
		echo disabled > /sys/devices/platform/AMDI0010:03/i2c-1/i2c-PIXA3854:00/power/wakeup
		echo disabled >/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:4b/PNP0C09:00/PNP0C0D:00/power/wakeup
		echo disabled > /sys/devices/pci0000:00/0000:00:14.3/PNP0C09:00/PNP0C0D:00/power/wakeup
		exit 0
		;;
	post)	#echo AMDI0010:03 >/sys/bus/platform/drivers/i2c_designware/bind
		#echo 1-4 >/sys/bus/usb/drivers/usb/bind
		exit 0
		;;
 	*)	exit 1
		;;
esac
4 Likes

Can I ask how you determined the proper locations to write disabled to?

I’m looking to replicate this on Fedora instead of Ubuntu, but it appears things are somewhat different for my case as only 2 of the 4 paths from this script exist on my system.

  • /sys/devices/platform/AMDI0010:03/i2c-1/i2c-PIXA3854:00/power/wakeup
    :check_mark: This path exists
  • /sys/devices/pci0000:00/0000:00:14.3/PNP0C09:00/PNP0C0D:00/power/wakeup
    :check_mark: This path exists
  • /sys/devices/pci0000:00/0000:00:08.1/0000:c1:00.3/usb1/1-4/1-4.3/power/wakeup
    :cross_mark: This path exists up until 0000:00:08.1/ but does not exist beyond
  • /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:4b/PNP0C09:00/PNP0C0D:00/power/wakeup
    :cross_mark: This path exists up until device:4b/ but does not exist beyond

Maybe you might not know exactly which paths I need for my case, but if you could share how you found the correct paths for your system, perhaps I can do the same to find them for mine.