Shutting your laptop lid at the end of the workday, slipping it into a backpack, and pulling it out an hour later burning hot with a half-drained battery means Ubuntu stayed awake instead of suspending properly.
Whether an earlier tweak ignored lid switches, a docked external screen held sleep back, or a noisy USB accessory kept waking the PC inside your sleeve, fixing lid-close sleep safely protects both battery health and laptop hardware.
Unplug External Displays and Check GNOME Tweaks
Ubuntu intentionally keeps a laptop awake when you close the lid if an external HDMI or USB-C monitor (or USB-C dock) is still attached — and occasionally someone toggles lid-suspend off globally inside GNOME Tweaks and forgets afterwards.
- Before shutting the lid to pack your laptop away, disconnect HDMI cables and USB-C monitor hubs first so Ubuntu knows you are no longer using desktop clamshell mode.
- Open Tweaks (GNOME Tweaks — if not installed, you can install it cleanly from Ubuntu App Center or skip straight to Step 2 below).
- Inside Tweaks -> General, confirm Suspend when laptop lid is closed is switched On.
Check logind Lid Switch Rules in Terminal
If your laptop ignores lid closing even with zero cables connected, inspect Ubuntu’s system power configuration file to ensure no old override says ignore.
- Press
Ctrl + Alt + Tto open Terminal. - Run
grep HandleLidSwitch /etc/systemd/logind.confto inspect current rules without changing anything yet. - If you see active uncommented lines (no
#in front) readingHandleLidSwitch=ignore,HandleLidSwitchExternalPower=ignore, orlock, open the file cleanly withsudo nano /etc/systemd/logind.conf. - Change those active lines back to
HandleLidSwitch=suspend(or add#in front to restore Ubuntu defaults), pressCtrl + Othen Enter to save, andCtrl + Xto exit. - Save any open documents first and reboot Ubuntu once so the updated lid policy takes effect cleanly.
Test Manual Suspend and Watch Out for USB Wakeups
- Test manual sleep first: Click the top-right Quick Settings power icon -> click Suspend while the lid is open. Wait ten seconds to verify the power LED pulses slowly and fans stop spinning completely — if even manual Suspend fails to stay asleep, a plugged-in wireless mouse dongle or BIOS Modern Standby compatibility quirk may be waking the laptop straight back up.
- Keep wireless mouse receivers unplugged or turned off in bags: Even a slight nudge on a wireless mouse inside a backpack wakes many laptops instantly through USB wake signals unless switched off via its bottom switch.
Restoring default HandleLidSwitch=suspend behaviour, checking GNOME Tweaks, and disconnecting external monitors or active mice before packing up prevents overheated backpacks completely.