Skip to main content

snsr

A playful Python-based "screensaver" that randomly moves your mouse and simulates key presses to keep your screen active.

Features

  • Moves the mouse to random screen positions.
  • Simulates random key presses.
  • Keeps your system from going idle (uses wakepy when available).
  • Auto-selects an input backend per platform (pynput on Linux, pyautogui elsewhere) with fallback.

Usage

Using uv

uvx snsr

snsr auto-detects your platform/session and picks the best backend (Linux defaults to the pynput backend; macOS and Windows use pyautogui), with fallback if the preferred backend fails to start.

Using pip

pip install snsr
snsr

It will:

  • Move your mouse to random points (or jiggle relative on Linux)
  • Press a random key (default set: a, s, d, f, j, k, l)
  • Repeat every few seconds

Options

snsr [--interval LOW HIGH] [--keys CHARS] [--backend {auto,pyautogui,pynput}]
     [--no-failsafe] [--dry-run] [-v]
  • --interval LOW HIGH — random sleep range in seconds between actions (default 1 5).
  • --keys CHARS — string of single-character keys to choose from (default asdfjkl).
  • --backend — force a specific backend, or leave on auto.
  • --no-failsafe — disable pyautogui's corner-abort failsafe (off by default — moving the mouse to a screen corner aborts).
  • --dry-run — log what would happen without actually moving the mouse or pressing keys.
  • -v, --verbose — debug logging.

Logs are written to a per-platform user state directory (e.g. ~/.local/state/snsr/snsr.log on Linux, %LOCALAPPDATA%\snsr\snsr.log on Windows, ~/Library/Logs/snsr/snsr.log on macOS).

To Stop

Press Ctrl+C in the terminal to exit. By default the pyautogui backend also lets you abort by slamming the mouse into a screen corner.

Notes

  • Ensure your OS allows simulated input events from Python scripts.
  • Useful for keeping your machine awake during long tasks (e.g., rendering, builds, meetings).

Disclaimer

This project is intended for educational or personal use only. Use responsibly and respect your organization's policies regarding input automation.


MIT License © 2025

Metadata

Release files for snsr 0.1.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for snsr 0.1.9
File Size Uploaded
snsr-0.1.9.tar.gz 5.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for snsr 0.1.9
File Interpreter ABI Platform
snsr-0.1.9-py3-none-any.whl Python 3 none any Details

Total release size: 11.4 kB

Release files / snsr-0.1.9.tar.gz

Download URL snsr-0.1.9.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
6cff1c70ac7c9b07117f65e6f3ca7bae930c5012634d1dd39eb63ba7d1a42fda
BLAKE2b-256 checksum
How to use checksums
29fcf3b441753cb0b1baa44c83f4af880770e9d4799a48f9858248c725060337
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"44","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / snsr-0.1.9-py3-none-any.whl

Download URL snsr-0.1.9-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f97221dae3fed9dfcc9586de6a3d657f32d32fea2c77c2744ba3d26aa05e0968
BLAKE2b-256 checksum
How to use checksums
cd342f49c86b0e8d037c4c70a7e43e668a2042e780ee46daa3a4ab68f73d556f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"44","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.1.9 This release

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page