FG
💻 Software

Prevent laptop from going to sleep when I close the lid, but only if I'm connected to an external display

Fresh5 days ago
Mar 15, 20263944 views
Confidence Score0%
0%

Problem

When I'm connected to an external display, I would like to close the laptop without it going to sleep. When I'm not connected to an external display, I would like to have closing the lid put the laptop to sleep. I know I can achieve this by manually switching the power settings, but I'd like someth…

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Prevent laptop from going to sleep when I close the lid, but only if I'm connected to an external display

Low Risk

Write a script or service, that detects if an external display is connected. If it is, have the script/service turn on sleep setting. If it is not, have the script/service turn off sleep setting again. Other than that I am not aware of a solution.

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment