Keep Awake 🔌
Prevent system sleep/idle while Visual Studio Code is active
Features
- 🛡️ Automatic sleep prevention when VS Code is running
- 🖥️ Cross-platform support (Windows, macOS, Linux)
- 🔋 Power-aware - Stops when VS Code closes
- ⚙️ Zero configuration required
- 🚫 No admin privileges needed
Supported Methods
Platform |
Method |
Windows |
Simulate F15 key every 55s |
macOS |
Native caffeinate utility |
Linux |
systemd-inhibit or xdg-reset |
Usage
The extension works automatically after installation. You'll see a status bar notification when active.
Requirements
- VS Code 1.98.2+
- System Requirements:
- Windows: PowerShell 5.1+
- macOS: Built-in utilities
- Linux:
systemd-inhibit or xdg-screensaver
Troubleshooting
If sleep prevention isn't working:
- Check VS Code's Output panel (
View > Output )
- Select "No Sleep" from the dropdown
- Look for error messages
Common solutions:
# Linux systems may require:
sudo apt install xdg-utils # Debian/Ubuntu
sudo yum install xdg-utils # RHEL/CentOS
FAQ
❓ Does this affect battery life?
Yes - prevents system sleep, which may increase power consumption.
❓ Can I disable it temporarily?
No
❓ Is this safe?
Absolutely! No elevated permissions required.
Acknowledgements
- VS Code Extension API documentation
- Apple
caffeinate team
- Linux systemd contributors
Happy coding without interruptions! 🚀
| |