-->

DEVOPSZONES

  • Recent blogs

    Keep Laptop Active (Mouse Jiggler)

     To simulate activity on your laptop even when your mouse/keyboard is idle, you can use a Python script that moves the mouse cursor slightly at intervals—this tricks your operating system into thinking you're still active.

    Here's a simple cross-platform solution using Python and the pyautogui library.


    ✅ Python Script: Keep Laptop Active (Mouse Jiggler)

    📦 Prerequisites (install once):

    pip install pyautogui
    

    🧠 Python Code:

    import pyautogui
    import time
    
    print("Simulating activity. Press Ctrl+C to stop.")
    
    try:
        while True:
            pyautogui.move(1, 0, duration=0.1)  # Move 1 pixel to the right
            pyautogui.move(-1, 0, duration=0.1) # Move back
            time.sleep(30)  # Repeat every 30 seconds
    except KeyboardInterrupt:
        print("\nStopped simulation.")
    

    💡 Notes:

    • You can change the time.sleep(30) value to adjust the interval.

    • Movements are minimal (±1 pixel) and usually invisible to the user.

    • This works on Windows, macOS, and Linux.


    ❗ Alternatives:

    • Windows: Use tools like Mouse Jiggler

    • macOS: Use caffeinate command to prevent sleep:

      caffeinate -d -i -m -s
      
    • Linux: Use xdotool to simulate input (needs GUI/X11).

    No comments