Metadata-Version: 2.4
Name: donotsleep
Version: 0.3.0
Summary: Prevent your computer from sleeping by simulating safe media key activity.
Keywords: sleep,automation,desktop,utility,productivity
Author: Bipin Subedi
Author-email: Bipin Subedi <contact@bipinsubedi.com>
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: End Users/Desktop
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Desktop Environment
Classifier: Topic :: Utilities
Requires-Dist: customtkinter>=5.2.0
Requires-Dist: pyautogui>=0.9.54
Requires-Python: >=3.8
Project-URL: Homepage, https://github.com/bipinsubedi/donotsleep
Project-URL: Repository, https://github.com/bipinsubedi/donotsleep
Project-URL: Issues, https://github.com/bipinsubedi/donotsleep/issues
Description-Content-Type: text/markdown

# donotsleep

`donotsleep` is a lightweight desktop utility that helps keep your system awake by sending periodic media key events.

It opens a simple GUI where you can:

- Set the activity interval
- Add randomized timing variation
- Start/stop behavior immediately

## Why This Exists

Some workloads (long downloads, streaming dashboards, remote sessions, monitoring windows) are interrupted when the host device sleeps. This tool provides a minimal way to keep activity alive while you are away.

## Features

- GUI-first usage with instant start
- Optional CLI interval argument
- Randomized interval variation to reduce strict timing patterns
- Background launch on both Windows and Linux (terminal can be closed after start)
- Native Linux sleep inhibition (`systemd-inhibit` and `xdg-screensaver`) supporting both Wayland and X11 out of the box
- Zero extra configuration or OS-specific settings required

## Requirements

- Python 3.8+
- Windows or Linux (supports Ubuntu, Fedora, Debian, Arch, etc. under Wayland & X11)

## Installation & Running

### Run directly with `uvx` (no install needed)

```bash
uvx donotsleep
```

### From PyPI

```bash
pip install donotsleep
```

### Local Development

```bash
uv sync
```

## Usage

### Start With Defaults (Detached in Background)

```bash
donotsleep
```

Or with `uvx`:

```bash
uvx donotsleep
```

### Start With Custom Interval

```bash
donotsleep 120
```

### Run In Foreground (debugging)

```bash
donotsleep --no-detach
```

## Behavior Notes

- Default interval is `100` seconds.
- Interval range is `10-300` seconds.
- Randomization range is `0-20%`.
- **Windows**: Simulates periodic `volumedown` and `volumeup` key events.
- **Linux**: Automatically engages native system sleep inhibition (`systemd-inhibit`, `xdg-screensaver`) to prevent idle timeout, screen lock, and system sleep across both Wayland and X11 desktop sessions without requiring manual permissions. Also sends simulated media keys when supported.

## Development

```bash
uv sync
uv run donotsleep 100 --no-detach
```

## Build

```bash
uv build
```

## Publish (PyPI)

```bash
uv publish
```

## Security and Responsibility

Use this tool only on systems you own or are authorized to manage. Some managed environments may restrict synthetic input automation.

## License

MIT License. See [LICENSE](LICENSE).