├── README.md ├── ktmm.py └── requirements.txt /README.md: -------------------------------------------------------------------------------- 1 | # ktmm (Keep That Mouse Moving!) 2 | 3 | 4 | ## What is this? 5 | Ever needed to stop your computer from going into Idle mode? 6 | 7 | Now it's super simple! 8 | 9 | ## How does it work? 10 | This little guy will move your mouse back and forth a tiny little bit every second; and you won't even notice it! 11 | 12 | ## When would I ever use this? 13 | Works well in companies where you can't stop your computer from Idling and things start showing as you're away when you've decided to go relax on the beach! 14 | 15 | ## Why was this utility made? 16 | The author could not stop the screensaver from being triggered after 5 minutes (permissions issues) and while waiting for gcc/make/other to complete compiling the project files, the machine would lock up and turn off (thanks big brother company..). 17 | 18 | This utility makes sure that the screensaver is never triggered and the compile job completes with smiles all around! 19 | 20 | It also makes sure that the computer never, ever, ever goes into Idle mode.. 21 | 22 | ## 1. Get Setup 23 | 24 | ``` 25 | git clone https://github.com/ao/ktmm.git 26 | cd ktmm 27 | pip install -r requirements.txt 28 | ``` 29 | 30 | ## 2. Now run it 31 | `python ktmm.py` 32 | 33 | There's no need to stop it, unless you really do want to go idle! 34 | 35 | 36 | ## If you want to run it in a virtualenv then do this instead: 37 | 38 | ``` 39 | git clone https://github.com/ao/ktmm.git 40 | cd ktmm 41 | virtualenv -p python3 env 42 | . env/bin/activate 43 | pip install -r requirements.txt 44 | python ktmm.py 45 | ``` 46 | 47 | # Looking for a cross-platform version? 48 | If you need a cross-platform version, you can use the [Java version](https://github.com/ao/ktmm-java) 49 | -------------------------------------------------------------------------------- /ktmm.py: -------------------------------------------------------------------------------- 1 | """ 2 | Name: ktmm 3 | Brief: 'Keep That Mouse Moving' 4 | Description: Stops a computer from going into IDLE mode 5 | Created by: Andrew Odendaal (https://github.com/ao/ktmm) 6 | """ 7 | 8 | from pynput.mouse import Controller 9 | import time 10 | 11 | if __name__ == '__main__': 12 | mouse = Controller() 13 | while True: 14 | mouse.move(0.1, 0.1) 15 | time.sleep(10) 16 | mouse.move(-0.1, -0.1) 17 | time.sleep(10) 18 | 19 | # Oh damn, that was simple! 20 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | pynput==1.4 2 | pyobjc-core==4.2.2 3 | pyobjc-framework-Cocoa==4.2.2 4 | pyobjc-framework-Quartz==4.2.2 5 | six==1.11.0 6 | --------------------------------------------------------------------------------