Let's set the lid thing aside.
I will ask you to test a couple of things, but first, after doing this:
# echo enabled > /sys/devices/platform/i8042/serio0/power/wakeup
you should be able to use the keyboard to wake up the machine from suspend-to-idle. Please check if that works for you.
If it works, it is sufficient to do the above once per boot from the init scripts.
Let's set the lid thing aside.
I will ask you to test a couple of things, but first, after doing this:
# echo enabled > /sys/devices/ platform/ i8042/serio0/ power/wakeup
you should be able to use the keyboard to wake up the machine from suspend-to-idle. Please check if that works for you.
If it works, it is sufficient to do the above once per boot from the init scripts.