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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

snsr-0.1.9.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

snsr-0.1.9-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file snsr-0.1.9.tar.gz.

File metadata

  • Download URL: snsr-0.1.9.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for snsr-0.1.9.tar.gz
Algorithm Hash digest
SHA256 6cff1c70ac7c9b07117f65e6f3ca7bae930c5012634d1dd39eb63ba7d1a42fda
MD5 10effbafce25d53ac2df8ae298b64c78
BLAKE2b-256 29fcf3b441753cb0b1baa44c83f4af880770e9d4799a48f9858248c725060337

See more details on using hashes here.

File details

Details for the file snsr-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: snsr-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for snsr-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 f97221dae3fed9dfcc9586de6a3d657f32d32fea2c77c2744ba3d26aa05e0968
MD5 6a6f933baf53a902248954efcaa1888c
BLAKE2b-256 cd342f49c86b0e8d037c4c70a7e43e668a2042e780ee46daa3a4ab68f73d556f

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.9 This release

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page