Skip to main content

Keep your system active by simulating mouse, keyboard, or typed input at configurable intervals

Project description

nosleepy

PyPI version Python License: MIT GitHub

Keep your system active with realistic typed input simulation — types random phrases into a hidden invisible window, never your active window.

nosleepy demo


Quickstart

pip install nosleepy
nosleepy -m xlib --pause 37 --words 30

Install

pip install nosleepy

# or
pip3 install nosleepy

Via Snap

sudo snap install nosleepy

Run (recommended)

nosleepy -m xlib --pause 37 --words 30

Modes

Mode What it does
xlib Types phrases into a hidden 1×1 invisible window — no GUI trace (recommended)
xdotool Types phrases into a minimized sink xterm window
mouse Moves mouse diagonally (default)
keyboard Presses Shift key
both Mouse + Shift
scroll Scrolls mouse wheel

All Options

-m MODE, --mode MODE            xlib (recommended), xdotool, mouse, keyboard, both, scroll
--pause SECONDS                 Fixed pause between typed phrases. e.g. --pause 37
--words MAX or MIN MAX          Words per phrase. e.g. --words 30 or --words 20 30. Default: 20 30
-s SECONDS, --seconds SECONDS   Idle wait seconds for mouse/keyboard modes. Default: 300
-p PIXELS, --pixels PIXELS      Pixels to move mouse. Default: 1
-c, --circular                  Move mouse in a circle
-r MIN MAX, --random MIN MAX    Random interval. e.g. -r 30 60
-a LEVEL, --activity LEVEL      Activity % for xlib/xdotool (50-95). Default: 75
--version                       Show version
-h, --help                      Show help

Examples

# Recommended
nosleepy -m xlib --pause 37 --words 30

# Shorter phrases
nosleepy -m xlib --pause 37 --words 15

# Faster cadence
nosleepy -m xlib --pause 20 --words 30

# Move mouse every 60 seconds
nosleepy -m mouse -s 60

# Run for 2 hours then stop
timeout 2h nosleepy -m xlib --pause 37 --words 30

# Stop anytime
Ctrl + C

FAQ

Does it work on Wayland?

No. Run on X11 or use XWayland.

Does it affect my active window?

No. xlib mode creates an invisible off-screen window. Keystrokes never reach your active app.

Any memory leak or leftover processes?

No. The hidden window lives only while the process runs. On exit everything is cleaned up automatically.

What is the difference between --pause and --activity?

  • --pause — fixed wait between phrases (recommended for human-like cadence)
  • --activity — percentage of time spent typing (continuous rapid mode)

Run on startup

GNOME / KDE: Add to Startup Applications:

nosleepy -m xlib --pause 37 --words 30

Systemd:

[Unit]
Description=nosleepy

[Service]
ExecStart=nosleepy -m xlib --pause 37 --words 30
Restart=always

[Install]
WantedBy=default.target
systemctl --user enable --now nosleepy

Support

If nosleepy is useful to you, consider buying me a coffee!

ko-fi


Links

Project details


Download files

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

Source Distribution

nosleepy-2.0.0.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

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

nosleepy-2.0.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file nosleepy-2.0.0.tar.gz.

File metadata

  • Download URL: nosleepy-2.0.0.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for nosleepy-2.0.0.tar.gz
Algorithm Hash digest
SHA256 49dbc945f8ec4eeace020c37a8d360cb14b17ce05ae1b1c288ab9bee34543217
MD5 1d6e1f72e6fa2978b7a9721e144eb17d
BLAKE2b-256 cc028a0479d375d3f39c5a6ff180ac6782a1d012774c4e269ff58fc7fc2c5fa2

See more details on using hashes here.

File details

Details for the file nosleepy-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: nosleepy-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for nosleepy-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 24e7b1a99a83e6a5d58cf427aada65ce727d5b181cfb24f417077d54b750dca7
MD5 7e83142dee63671d41d8d52316ee79c4
BLAKE2b-256 0c41c93d3c22ce48c826eb82a72ff9d5c2b3e0e428e0e142b2eed1d59df966b9

See more details on using hashes here.

Supported by

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