This behavior is usually controlled by your laptop's firmware (BIOS/UEFI), not by Linux itself. Many modern laptops have a feature called "Power On Lid Open" or similar, which automatically powers on the laptop when you open the lid.
To disable this feature:
1. Enter BIOS/UEFI Settings
- Shut down your laptop completely.
- Turn it on and immediately start pressing the BIOS/UEFI access key (commonly
F2, F10, F12, Del, or Esc—check your laptop's manual or look for a splash screen hint).
- Navigate through the menus. Look for settings related to Power, Advanced, or Boot.
2. Find the "Power On Lid Open" Option
- The setting might be called:
- "Power On Lid Open"
- "Lid Open Resume"
- "Wake on Lid Open"
- "Flip to Start"
- Disable this option.
3. Save and Exit
- Save your changes and exit the BIOS/UEFI.
4. Test
- Shut down your laptop, close the lid, then open it. The laptop should not power on automatically.
If You Can't Find the Option
- Not all laptops have this setting exposed in BIOS/UEFI. Some manufacturers (especially recent Dell, Lenovo, HP, Asus, etc.) may or may not allow you to disable it.
- If you can't find the option, check your laptop's manual or the manufacturer's support website for details.
- Sometimes, a BIOS/UEFI update adds or removes this feature.
Linux Software Workarounds
There is no reliable Linux-side fix for this, because the power-on event happens before the operating system loads. However, you can control what happens after the lid is opened (e.g., suspend, hibernate), but not the initial power-on behavior.
Summary:
You need to disable this feature in your laptop's BIOS/UEFI settings. If the option is not available, it may not be possible to disable it on your specific model.
If you tell me your laptop brand and model, I can try to find more specific instructions!