-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmouse_jiggle.py
More file actions
executable file
·38 lines (33 loc) · 887 Bytes
/
mouse_jiggle.py
File metadata and controls
executable file
·38 lines (33 loc) · 887 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env python3
# Mouse Jiggle
#
# Author: Wes Moskal-Fitzpatrick
#
# Jiggle the mouse a little bit and prevent remote desktop logout.
#
import argparse
import pyautogui
def main(distance, interval):
while True:
pyautogui.moveRel(distance, 0, duration=0)
pyautogui.PAUSE = interval
pyautogui.moveRel(-distance, 0, duration=0)
pyautogui.press("shift")
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Keep the system active")
parser.add_argument(
"-d",
"--distance",
type=int,
default=5,
help="Distance in pixels to move the mouse",
)
parser.add_argument(
"-i",
"--interval",
type=float,
default=0.5,
help="Pause between movements in seconds",
)
args = parser.parse_args()
main(args.distance, args.interval)