Prevent Laptop Sleep Mode When Closed: Easy Fixes And Tips

how to get laptop to not sleep when closed

Many laptop users encounter the issue of their device automatically going to sleep when the lid is closed, which can be inconvenient when using an external monitor or during tasks that require continuous operation. To prevent this, users can adjust their laptop's power settings to disable the sleep function when the lid is shut. This can typically be done through the operating system's power options, where users can customize what happens when the laptop lid is closed, allowing for uninterrupted use even when the screen is physically closed.

Characteristics Values
Operating System Windows, macOS, Linux
Power Settings Adjust power plan settings to prevent sleep when lid is closed
Windows Method Go to Control Panel > Power Options > Change plan settings > Change advanced power settings
macOS Method Go to System Preferences > Battery > Turn off "Close lid" sleep option
Linux Method Edit /etc/systemd/logind.conf and set HandleLidSwitch=ignore
Third-Party Software Use tools like Insomnia or Caffeine to keep the laptop awake
BIOS/UEFI Settings Disable lid closure action in BIOS/UEFI settings (varies by manufacturer)
External Display Connect an external monitor and configure settings to keep the laptop active
Command Line (Windows) Use powercfg /SETACVALUEINDEX SCHEME_CURRENT SUB_SLEEP LIDACTION 1
Command Line (macOS) Use sudo pmset -a lidwake 0 to disable lid sleep
Hardware Modification Physically disable the lid switch (not recommended, may void warranty)
Automation Tools Use Task Scheduler (Windows) or Automator (macOS) to run scripts preventing sleep
Network Activity Enable "Wake on LAN" or keep active network connections to prevent sleep
Battery Considerations Ensure laptop is plugged in if preventing sleep to avoid battery drain
Manufacturer-Specific Settings Check laptop manufacturer's support page for model-specific settings
Remote Access Use remote desktop tools to keep the laptop active even when closed

shunsleep

Disable sleep mode in power settings

To disable sleep mode in power settings and prevent your laptop from sleeping when closed, you’ll need to adjust the power plan settings in your operating system. This process varies slightly between Windows, macOS, and Linux, but the core steps remain similar. Below is a detailed guide focused on disabling sleep mode in power settings.

For Windows Users: Start by opening the Power Options menu. You can do this by right-clicking the battery icon in the system tray and selecting "Power Options," or by searching for "Power Options" in the Start menu. Once in the Power Options window, locate your active power plan (Balanced, Power Saver, or High Performance) and click "Change plan settings" next to it. In the next window, click "Change advanced power settings." A new dialog box will appear, where you can expand the "Sleep" section. Here, you’ll find options for "Sleep after" and "Allow hybrid sleep." Set both "On battery" and "Plugged in" values to "Never" under "Sleep after." Additionally, ensure "Allow hybrid sleep" is set to "Off." Save the changes, and your laptop will no longer enter sleep mode automatically, even when closed.

For macOS Users: On a Mac, open "System Settings" (or "System Preferences" on older versions) and click on "Battery" or "Energy Saver," depending on your macOS version. In the Battery or Energy Saver settings, look for the "Turn display off after" or "Computer sleep" option. Set both the battery and power adapter options to "Never" to prevent the laptop from sleeping. However, this setting typically applies when the lid is open. To ensure the laptop doesn't sleep when closed, you may need to use a third-party app or Terminal command, as macOS does not natively support this feature. Alternatively, you can adjust the "Lid close" action in "Battery" settings to "Do nothing" if available.

For Linux Users (Ubuntu Example): In Ubuntu or similar distributions, open the "Settings" app and navigate to "Power." Here, you can adjust the "Suspend & Power Button" settings. Set the "Suspend when inactive for" option to "Never" for both "On Battery Power" and "Plugged In." Additionally, you can modify the behavior of the lid when closed by running a command in the Terminal. Open Terminal and type `sudo nano /etc/systemd/logind.conf`, then find the line `#HandleLidSwitch=suspend` and change it to `HandleLidSwitch=ignore`. Save the file and restart the systemd-logind service by running `sudo systemctl restart systemd-logind.service`. This will prevent the laptop from sleeping when the lid is closed.

Additional Tips: Regardless of your operating system, ensure that any external power-saving features, such as BIOS/UEFI settings, are configured to allow the laptop to remain active when closed. For example, in BIOS/UEFI, check for options like "Lid Close Action" and set it to "Do Nothing." Also, if you’re using a docking station or external monitor, ensure the laptop is set to stay awake when connected to these devices.

By following these steps to disable sleep mode in power settings, you can ensure your laptop remains active even when the lid is closed, which is particularly useful for tasks like downloading files, running servers, or using the laptop as a media center. Always remember to save your changes and test the settings to confirm they work as intended.

shunsleep

Use third-party apps to keep laptop awake

If you're looking to keep your laptop awake when closed, using third-party applications can be an effective solution. These apps are designed to prevent your laptop from going to sleep or hibernating, even when the lid is shut. One popular option is Insomnia, a lightweight app for Windows that ensures your system stays awake without altering power settings. To use Insomnia, simply download and install the application, then activate it to keep your laptop running. It’s particularly useful for tasks like file downloads, backups, or running servers that require uninterrupted operation.

Another reliable third-party app is Caffeine for Windows or Caffeine for macOS, which temporarily prevents your laptop from sleeping with a single click. For Windows users, Caffeine adds an icon to the system tray, allowing you to toggle the "awake" mode on or off. On macOS, Caffeine works similarly by keeping the system active when enabled. Both versions are easy to use and do not require complex configurations, making them ideal for users who need a quick and straightforward solution to keep their laptop awake when closed.

For Linux users, KeepAwake is a handy tool that prevents the system from suspending or sleeping. It can be installed via package managers like apt or snap, depending on your distribution. Once installed, you can activate KeepAwake from the command line or system tray (if available) to ensure your laptop remains active even with the lid closed. This app is particularly useful for developers or users running long-running processes that cannot be interrupted.

If you prefer a more customizable solution, Don’t Sleep is a Windows application that offers advanced options to control sleep behavior. It allows you to disable sleep mode, hibernation, or even turn off the display while keeping the system awake. Don’t Sleep also includes a timer feature, enabling you to set specific durations for which your laptop should remain active. This flexibility makes it a great choice for users who need precise control over their laptop’s power settings.

Lastly, Prevent Display Sleep is a macOS app that focuses on keeping the display active, which indirectly prevents the laptop from sleeping when closed. It works by simulating keyboard activity at regular intervals, tricking the system into thinking the user is still active. While it’s primarily designed for display management, it can be used in conjunction with other settings to ensure your laptop stays awake when the lid is closed. Always ensure that the app you choose is compatible with your operating system and meets your specific needs.

shunsleep

Adjust lid close action in system settings

To prevent your laptop from sleeping when closed, one of the most effective methods is to adjust the lid close action in your system settings. This involves changing how your operating system responds when you close the laptop lid, allowing it to remain awake even when shut. The process varies slightly depending on whether you’re using Windows, macOS, or Linux, but the core idea remains the same: modify the power settings to disable sleep mode when the lid is closed.

For Windows Users: Begin by opening the Settings app, which you can access from the Start menu or by pressing `Win + I`. Navigate to System and then select Power & Sleep from the left-hand menu. Scroll down to the When I Close the Lid section. Here, you’ll see separate options for when the laptop is plugged in and when it’s on battery power. Click on the dropdown menus and change both settings to Do Nothing. This ensures that closing the lid does not trigger sleep mode. Additionally, go to Additional Power Settings and click on Choose What Closing the Lid Does to double-check and confirm the changes.

For macOS Users: On a Mac, open System Settings (or System Preferences on older versions) by clicking the Apple menu in the top-left corner of the screen. Select Battery or Energy Saver, depending on your macOS version. Look for the Lid Close option and adjust the settings to Prevent Sleep When Closed on Power Adapter or Prevent Sleep When Closed on Battery, depending on your preference. If you want the laptop to stay awake in both scenarios, ensure both options are enabled. This prevents the Mac from entering sleep mode when the lid is closed.

For Linux Users (Ubuntu Example): If you’re using Ubuntu or a similar Linux distribution, open Settings from the application menu and select Power. Under the When Lid is Closed section, you’ll find options for both On Battery Power and Plugged In. Change both settings to Do Nothing to disable sleep mode when the lid is closed. Some Linux distributions may require you to edit the `logind.conf` file in the terminal. To do this, open the terminal and type `sudo nano /etc/systemd/logind.conf`, then find the line `#HandleLidSwitch=suspend` and change it to `HandleLidSwitch=ignore`. Save the file and restart your system for the changes to take effect.

After adjusting the lid close action in your system settings, test the changes by closing the laptop lid to ensure it remains awake. If the issue persists, double-check the settings or consider updating your operating system or BIOS/UEFI firmware, as outdated software can sometimes interfere with power management settings. By following these steps, you can effectively prevent your laptop from sleeping when closed, allowing it to continue running tasks or staying connected to external displays without interruption.

shunsleep

Modify BIOS/UEFI settings for sleep behavior

Modifying BIOS/UEFI settings is a direct and effective way to control your laptop's sleep behavior when the lid is closed. The BIOS (Basic Input/Output System) or UEFI (Unified Extensible Firmware Interface) is the firmware interface that initializes your hardware during the boot process and manages system settings. By adjusting these settings, you can prevent your laptop from sleeping or shutting down when the lid is closed. To begin, restart your laptop and access the BIOS/UEFI setup by pressing the designated key (commonly F2, Delete, or Esc) during the boot screen. The exact key varies by manufacturer, so consult your laptop’s manual or look for on-screen instructions during startup.

Once inside the BIOS/UEFI interface, navigate to the Power Management or Advanced settings menu. This menu typically contains options related to power behavior, including lid closure actions. Look for settings labeled "Lid Close Action" or "When I Close the Lid." Depending on your BIOS/UEFI version, you may find options such as "Do Nothing," "Sleep," "Hibernate," or "Shut Down." Select "Do Nothing" to ensure your laptop remains active even when the lid is closed. If this option is not available, try disabling any power-saving features related to lid closure.

In some BIOS/UEFI interfaces, you may also find settings related to ACPI (Advanced Configuration and Power Interface) or S3/S4/S5 sleep states. Ensure that these settings are configured to allow the system to remain active when the lid is closed. For example, disabling deep sleep states (S4/S5) can prevent the laptop from hibernating or shutting down. Be cautious when modifying these settings, as incorrect configurations can affect system stability or power consumption.

After making the necessary changes, save your settings and exit the BIOS/UEFI interface. This is typically done by selecting "Save Changes and Exit" or pressing the designated key (often F10). Your laptop will restart, and the new settings will take effect. Test the configuration by closing the lid to ensure the laptop remains awake as intended.

Keep in mind that modifying BIOS/UEFI settings is a low-level system change, and incorrect adjustments can cause issues. If you encounter problems, revert to the default settings or consult your laptop’s manufacturer for guidance. Additionally, note that BIOS/UEFI interfaces vary widely across devices, so the exact steps may differ based on your laptop model and firmware version. Always proceed with caution and ensure you understand the implications of each setting before making changes.

shunsleep

Utilize command prompt or PowerShell scripts

To prevent your laptop from sleeping when closed using Command Prompt or PowerShell scripts, you can modify the power settings directly through system commands. This method is particularly useful for advanced users who prefer automation or need to apply settings across multiple devices. Below are detailed steps and scripts to achieve this.

Using Command Prompt to Modify Power Settings:

Open Command Prompt as an administrator by searching for "cmd" in the Start menu, right-clicking on it, and selecting "Run as administrator." To prevent the laptop from sleeping when closed, you need to modify the power plan settings. Use the `powercfg` command, which is a built-in Windows tool for managing power settings. First, list all available power plans by typing `powercfg /list` and pressing Enter. Identify the active power plan (e.g., "Balanced" or "Power saver") from the list. Next, set the laptop lid action to "Do nothing" when closed. Use the command `powercfg /setdcvalueindex SCHEME_BALANCED SUB_BUTTONS LIDACTION 0` for the balanced plan, replacing `SCHEME_BALANCED` with the appropriate scheme name if different. The `0` at the end corresponds to the "Do nothing" action. Restart your laptop for the changes to take effect.

Using PowerShell for Advanced Power Configuration:

PowerShell provides more flexibility and control over system settings. Open PowerShell as an administrator by searching for "PowerShell" in the Start menu, right-clicking on it, and selecting "Run as administrator." Use the `Get-CimInstance` cmdlet to retrieve the current power plan settings. Type `Get-CimInstance -ClassName Win32_PowerPlan -Filter "IsActive=$true"` to identify the active power plan. To modify the lid action, use the `Set-ItemProperty` cmdlet. For example, run `Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\f15576e8-98b7-4186-b944-eaafa660d073\0012ee47-9041-4b5d-9b77-5389a923944b" -Name "ACSettingIndex" -Value 0` for AC power and `Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\f15576e8-98b7-4186-b944-eaafa660d073\0012ee47-9041-4b5d-9b77-5389a923944b" -Name "DCSettingIndex" -Value 0` for battery power. The `0` value ensures the laptop does nothing when closed. Restart your laptop to apply the changes.

Automating the Process with Scripts:

For repeated use or deployment across multiple devices, create a batch script for Command Prompt or a PowerShell script. For Command Prompt, open Notepad and type the `powercfg` command mentioned earlier. Save the file with a `.bat` extension (e.g., `nosleep.bat`). Double-click the file to run it as an administrator. For PowerShell, create a `.ps1` file with the `Set-ItemProperty` commands. Ensure PowerShell execution policy allows scripts by running `Set-ExecutionPolicy RemoteSigned` in PowerShell. Double-click the `.ps1` file to execute it with administrative privileges.

Verifying the Changes:

After running the scripts, verify the settings by checking the power options in the Control Panel or Settings app. Go to "Power & sleep settings" and ensure the "When I close the lid" option is set to "Do nothing" for both battery and plugged-in modes. Alternatively, use the `powercfg /q` command in Command Prompt or `Get-CimInstance -ClassName Win32_PowerSetting` in PowerShell to query the current power settings and confirm the lid action has been updated.

By utilizing Command Prompt or PowerShell scripts, you can efficiently prevent your laptop from sleeping when closed, ensuring uninterrupted operation even with the lid shut. This method is ideal for users who prefer command-line tools or need to automate system configurations.

Frequently asked questions

You can change the power settings in your operating system. For Windows, go to *Settings > System > Power & Sleep*, and under "When I close the lid," select "Do nothing." For macOS, go to *System Preferences > Battery/Energy Saver*, and uncheck "Prevent computer from sleeping automatically when the display is off."

Yes, keeping the laptop awake when closed will consume more battery power, as the system continues to run. It’s best to use this setting only when the laptop is plugged in or when necessary.

Yes, there are third-party apps like "Insomnia" for Windows or "Amphetamine" for macOS that can help keep your laptop awake when the lid is closed, even if the default settings don’t allow it.

Closing the lid without sleep mode won’t damage the laptop, but it may overheat if the vents are blocked. Ensure proper ventilation to avoid any issues.

Simply go back to the power settings in your operating system and restore the default options for lid closure. For Windows, select "Sleep" under "When I close the lid." For macOS, recheck "Prevent computer from sleeping automatically when the display is off."

Written by
Reviewed by

Explore related products

Share this post
Print
Did this article help you?

Leave a comment