NoSleep: A Lightweight Utility for Preventing Windows Sleep Modes
Primary Purpose:
NoSleep is a lightweight utility designed to prevent Windows from activating screen saver, sleep mode, or lock screen. It is ideal for users who cannot adjust these settings due to corporate policies.
Key Features:
Prevents Automatic Activation: NoSleep stops the system from entering sleep mode, ensuring uninterrupted workflow.
Minimal Resource Usage: Running efficiently without extra permissions, it maintains a low footprint on your system.
Toggle Functionality: Easily control with a system tray icon, offering options to enable/disable features and autostart at login.
Configuration Options: Users can set preferences such as keeping the screen on or monitoring specific applications to manage sleep prevention dynamically.
Audience & Benefit:
Ideal for users restricted by corporate policies, NoSleep provides uninterrupted work sessions without requiring admin rights or bulky software like PowerToys' Awake tool. It offers a seamless experience inspired by Linux Caffeine, ensuring productivity remains unaffected.
Installation:
NoSleep can be installed via winget, offering a straightforward setup process.
This utility is perfect for maintaining focus and efficiency in environments where system settings are controlled externally.
README
NoSleep
NoSleep is a lightweight tool that prevents Windows from automatically activating the screen saver, sleep mode, or lock screen. It's designed for situations where you can't change these settings yourself—for example, due to corporate-enforced policies. Inspired by Linux Caffeine.
> Note: Windows PowerToys includes a tool called Awake that does the same thing, but PowerToys may require administrator privileges and is quite large. NoSleep aims to be as minimal as possible and runs without any extra permissions.
Installation
NoSleep can be installed via the Scoop package manager:
Alternatively, you can download the latest release manually from the releases page.
Usage
NoSleep is designed to be "set and forget". Once running, it sits in the Windows system tray and prevents your PC from sleeping.
Left‑click the tray icon to toggle the enabled state on or off. The icon changes to reflect the current state.
Right‑click the tray icon to open a menu with additional options:
Autostart at login – Start NoSleep automatically when you log in.
Keep screen on – Prevent the display from turning off while NoSleep is enabled.
Remember enabled state – Save the enabled state between application restarts.
Configure apps to monitor – Define a list of applications. If none of them are running, NoSleep automatically disables itself; if any monitored app is running, NoSleep enables itself and prevents sleep. This dynamic behavior only works when NoSleep is enabled by the user. (Available since v1.4.0)
To completely stop NoSleep, right‑click the tray icon and select Close.
Behavior Matrix
Enabled
Keep Screen On
System Behavior
Display Behavior
✅ On
✅ On
Sleep is prevented
Always on
✅ On
⬜ Off
Sleep is prevented
Can turn off
⬜ Off
Any
Normal system behavior (sleep may occur)
Can turn off
Requirements
.NET Framework 4.8 or later (4.x branch). This is typically preinstalled on Windows 10 and later. If needed, you can download it from Microsoft.
How It Works
NoSleep calls the SetThreadExecutionState function every 10 seconds, resetting Windows' display and idle timers. This process uses negligible CPU and only a small amount of RAM. The compiled binary includes icons (about 180 KB) and the core code.