Laptop Lid Close Won't Suspend in Linux? Fix It Here
Your laptop stays awake when you close the lid? This is a common issue on Linux, usually caused by wrong settings in systemd or GNOME. Here's how to fix it.
You close your laptop lid expecting it to sleep. Instead, the screen goes black, but the fan keeps running — or worse, the laptop stays fully awake. I've seen this on Ubuntu 22.04, Fedora 38, and even Arch. It usually happens after an update or when you switch desktop environments (like from GNOME to KDE). The error itself doesn't show a popup — it just silently ignores your lid close.
Why This Happens
The culprit is almost always systemd-logind. That's the service that handles lid events. But here's the sneaky part: your desktop environment (like GNOME) can override systemd's settings. So even if you set systemd to suspend on lid close, GNOME might say "nope, I'm in charge." Or the opposite — systemd is set correctly, but a second service like acpid is also listening, causing a conflict.
Another common cause: you have an external monitor plugged in, and your laptop decides "you're using a dock, so don't sleep." That's a feature, not a bug — but most people don't want that when they close the lid manually.
Step-by-Step Fix
Step 1: Check Current systemd Settings
Open a terminal and run this command:
loginctl show-session $(loginctl | grep $(whoami) | awk '{print $1}') | grep HandleLidSwitch
You'll see something like HandleLidSwitch=suspend or HandleLidSwitch=ignore. If it says ignore, that's your problem. If it says suspend, go to Step 3.
Step 2: Edit systemd Settings (if 'ignore')
Run this command to edit the config file:
sudo nano /etc/systemd/logind.conf
Find the line that says #HandleLidSwitch=ignore. Remove the # and change ignore to suspend. It should look like this:
HandleLidSwitch=suspend
Save and exit (Ctrl+O, Ctrl+X in nano). Then restart the service:
sudo systemctl restart systemd-logind
Test closing the lid. If it still doesn't work, move on.
Step 3: Check for GNOME Override (if you use GNOME)
GNOME can override systemd. Run:
gsettings get org.gnome.settings-daemon.plugins.power lid-close-ac-action
And also for battery:
gsettings get org.gnome.settings-daemon.plugins.power lid-close-battery-action
If either says 'nothing', change it to 'suspend':
gsettings set org.gnome.settings-daemon.plugins.power lid-close-ac-action 'suspend'
gsettings set org.gnome.settings-daemon.plugins.power lid-close-battery-action 'suspend'
Log out and back in. Try again.
Step 4: Disable acpid (if installed)
If you have acpid installed, it might fight with systemd. Check:
systemctl status acpid
If it's running, stop and disable it:
sudo systemctl stop acpid
sudo systemctl disable acpid
This is safe — systemd handles lid events fine on its own.
Step 5: Check for External Monitor Conflict
If you have a monitor plugged in, try unplugging it and closing the lid. If it works, you need to ignore external monitor on lid close. Edit the logind config again:
sudo nano /etc/systemd/logind.conf
Add this line (or uncomment it):
HandleLidSwitchExternalPower=suspend
That tells systemd to suspend even if power is plugged in. Restart logind again.
Still Fails? Things to Check
- Check the logs: Run
journalctl -u systemd-logind --since "5 minutes ago"and look for words like "lid" or "sleep". You might see an error like "Operation not supported". - Kernel parameter issue: Some laptops need
acpi_osi=Linuxin your boot parameters. Add it in GRUB:sudo nano /etc/default/grub, findGRUB_CMDLINE_LINUX, addacpi_osi=Linuxinside, then runsudo update-grub. - Check your BIOS: Some BIOS have a "lid open wake" option that can mess with suspend. Disable anything about lid or wake in BIOS.
- Different desktop environment? If you use KDE, check System Settings > Power Management. If you use Xfce, check Power Manager. Those can override systemd too.
One more thing — if you're on a laptop with dual GPUs (like Nvidia Optimus), the Nvidia driver sometimes blocks suspend. Try switching to the open-source nouveau driver temporarily to test. But that's a bigger topic for another day.
Was this solution helpful?