SleepWalker is a lightweight Windows application that allows you to control your computer's sleep behavior easily from the system tray. With SleepWalker, you can prevent your computer from entering sleep mode or re-enable sleep mode with just a click.
- Features
- Installation
- Usage
- Building from Source
- How It Works
- Requirements
- Contributing
- License
- Acknowledgments
- Prevent Sleep Mode: Stops the computer from entering sleep mode.
- Enable Sleep Mode: Allows the computer to sleep as per system settings.
- System Tray Application: Runs quietly in the background with an icon in the system tray.
- Easy Access: Quickly access all features through the context menu.
- Lightweight: Minimal resource usage.
-
Download the Latest Release:
- Visit the Releases page.
- Download the
SleepWalker.exe
file.
-
Run the Application:
- Double-click the downloaded
SleepWalker.exe
to start the application. - SleepWalker will minimize to the system tray.
- Double-click the downloaded
-
Accessing the Menu:
- Locate the SleepWalker icon in the system tray.
- Right-click the icon to open the context menu.
-
Prevent Sleep Mode:
- Click on Prevent Sleep.
- A notification will appear confirming that sleep mode is disabled.
-
Enable Sleep Mode:
- Click on Enable Sleep.
- A notification will appear confirming that sleep mode is enabled.
-
Exit Application:
- Click on Exit to close SleepWalker.
If you wish to build SleepWalker from source, follow these steps:
-
Clone the Repository:
git clone https://github.com/yourusername/SleepWalker.git
-
Open the Solution in Visual Studio:
- Navigate to the project directory.
- Open SleepWalker.sln with Visual Studio 2022 or later.
-
Restore NuGet Packages:
- Visual Studio should automatically restore any necessary packages.
-
Build the Solution:
- Go to Build > Build Solution or press Ctrl + Shift + B.
-
Run the Application:
- Press F5 to run the application in Debug mode.
SleepWalker uses the Windows API function SetThreadExecutionState to control the system's sleep behavior.
- Prevent Sleep: Calls SetThreadExecutionState with ES_CONTINUOUS | ES_SYSTEM_REQUIRED flags to prevent sleep.
- Enable Sleep: Calls SetThreadExecutionState with ES_CONTINUOUS flag to restore default behavior.
- Form1.cs: Contains the main logic and event handlers.
- Form1.Designer.cs: Contains the designer-generated code for UI components.
- NotifyIcon: Represents the icon in the system tray.
- ContextMenuStrip: Provides the context menu for the system tray icon.
- Operating System: Windows 7 or later
- .NET Framework: .NET 6.0 or higher
- Development Environment (for building from source):
- Visual Studio 2022 or later
- .NET Desktop Development workload installed
Contributions are welcome! Please follow these steps:
-
Fork the Repository:
- Click on Fork at the top right corner of the repository page.
-
Create a Feature Branch:
git checkout -b feature/YourFeature
-
Commit Your Changes:
git commit -am 'Add new feature'
-
Push to the Branch:
git push origin feature/YourFeature
-
Open a Pull Request:
- Navigate to your forked repository.
- Click on New Pull Request.
This project is licensed under MIT License.
- Icons8: For providing free icons used in the application.
- Microsoft Documentation: For guidance on using Windows API functions.