This program moves the mouse or presses a key when it detects that you are away from your computer.
It does nothing if you are using your computer, making it useful for tricking your machine into thinking you are still using it.
- Install from Pypi
- Install with Snap
- Manual installation
- Optional arguments
- FAQ
- Supporting the project
python3 -m pip install keep_presence
https://pypi.org/project/keep-presence/
keep-presence
# or
python3 -m keep_presence
sudo snap install keep-presence
keep-presence
git clone https://github.com/carrot69/keep-presence.git
cd keep-presence
python3 -m pip install pynput
python3 src/keep-presence.py
-h, --help show this help message and exit
-s SECONDS, --seconds SECONDS Define in seconds how long to wait after a user is
considered idle. Default 300.
-p PIXELS, --pixels PIXELS Set how many pixels the mouse should move. Default 1.
-c, --circular Move mouse in a circle. Default move diagonally.
-m MODE, --mode MODE Available options: keyboard, mouse, both (mouse & keyboard) and scroll.
Default is mouse.
This is the action that will be executed when the user is idle.
If keyboard is selected, the program will press the shift key.
If mouse is selected, the program will move the mouse.
If both is selected, the program will do both actions.
-r RANDOM RANDOM, --random RANDOM RANDOM
Usage: two numbers (ex. -r 3 10). Execute actions based on a
random interval between start and stop seconds.
Note: Overwrites the seconds argument.
No, currently the program doesn't support Wayland due to limitations in the underlying library (pynput). We're actively looking for solutions and will update this FAQ if/when Wayland support is available. You can track progress on the GitHub issue: GitHub issue
Linux offers the timeout command, which allows you to set a maximum runtime for any command.
Example:
timeout 30s keep-presence
- GNOME: Open "Startup Applications Preferences" (search for it in Activities).
- KDE Plasma: Search for "Startup Applications" in the Kickoff menu.
- Click "Add" to create a new entry.
- In the "Command" field, enter the command to run keep-presence with your desired options. Here's just an example:
keep-presence --circular --seconds 180 --pixels 1
- Change the command to fit your needs.
Using Systemd:
Alternatively, you can use Systemd to manage Keep-Presence as a startup service. Refer to the official Systemd documentation for detailed instructions on how to set this up.
If you've found Keep Presence to be helpful, you can buy me a coffee, thanks!