running echo " LID" > /proc/acpi/wakeup
as root will disable it but to make it permanent you have to create a service so first cd to /etc/systemd/system/
then create file like your-service-name.service
then your file should be like this :
[Unit]
Description=no wakeup when lid is open
[Service]
ExecStart=/bin/bash -c '[ "$(cat /proc/acpi/wakeup |grep -P -o "LID.*\*\K\w+")" == "enabled" ] && echo "LID" > /proc/acpi/wakeup'
[Install]
WantedBy=multi-user.target
then Reload the service files to include the new service :
sudo systemctl daemon-reload
Start your service:
sudo systemctl start your-service-name.service
enable your service on every reboot:
sudo systemctl enable example.service