Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ntamas/adrenaline
Keep your OS from sleeping with Python (supports Windows and macOS)
https://github.com/ntamas/adrenaline
Last synced: about 1 month ago
JSON representation
Keep your OS from sleeping with Python (supports Windows and macOS)
- Host: GitHub
- URL: https://github.com/ntamas/adrenaline
- Owner: ntamas
- Created: 2021-04-13T21:26:43.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-01-31T13:30:23.000Z (10 months ago)
- Last Synced: 2024-08-10T10:25:03.934Z (3 months ago)
- Language: Python
- Size: 163 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
`adrenaline`
============Simple Python module to prevent your computer from going to sleep. Supports
Windows and macOS at the moment; Linux support is coming soon (hopefully).Usage
-----The module provides a context manager named `prevent_sleep()`. The computer
will not go to sleep while the execution is in this context:```python
from adrenaline import prevent_sleepwith prevent_sleep():
# do something important here
...
```Optionally, you can also prevent the screen from turning off:
```python
with prevent_sleep(display=True):
# do something important here
...
```Command line interface
----------------------You can also use this module from the command line as follows:
```sh
$ python -m adrenaline
```The command line interface will prevent sleep mode as long as it is running.
Acknowledgments
---------------Thanks to [Michael Lynn](https://github.com/pudquick/pypmset) for figuring out
how to do this on macOS.Thanks to [Niko Pasanen](https://github.com/np-8/wakepy) for the Windows
version.