Back to Blog
Guide

DIY Mouse Jiggler: 5 Builds, From a Script to a $5 USB Board

Make your own mouse jiggler with a 6-line Python script, an AutoHotkey or PowerShell loop, an Arduino Pro Micro or Raspberry Pi Pico that plugs in as a USB mouse, or a watch under an optical mouse. Code for each, what it costs, and what IT can see.

Slack Green Team
September 26, 2026
October 7, 2026
5 min read
Share:
mouse jiggler
diy
arduino
python
raspberry pi pico

The simplest DIY mouse jiggler is a 6-line Python script that moves the pointer 1 pixel and back every 60 seconds. If you want hardware instead, a $5 board with native USB, such as an Arduino Pro Micro or a Raspberry Pi Pico, can plug in as a mouse and do the same with no software on the computer. Both reset the idle timer, so the screen stays on and apps that read system idle stay active. Below is working code for five builds, what each costs, and what each one looks like to IT.

A jiggler keeps the Slack desktop app active too, while the computer is awake and unlocked. The Slack desktop app counts keyboard and mouse input anywhere on the computer (Slack desktop 4.52.178 code, checked 7 Oct 2026), wherever the pointer is.

DIY mouse jiggler: Python with pyautogui, AutoHotkey, Arduino Pro Micro, Raspberry Pi Pico, watch trick

Which DIY mouse jiggler to build

Which DIY mouse jiggler to build: cost, what it needs, and how it shows up to IT
BuildCostNeedsShows up to IT as
Python script (pyautogui)FreePython, permission to control the pointerA running Python process
AutoHotkey script (Windows)FreeAutoHotkey v2A running AutoHotkey process
PowerShell F15 loop (Windows)FreeNothing to installA running PowerShell process
Arduino Leonardo or Pro MicroAbout $5 to $20ATmega32U4 board, Arduino IDEA USB device named Arduino Leonardo
Raspberry Pi PicoAbout $4 to $6CircuitPython and the adafruit_hid libraryA USB device named CircuitPython
Analog watch under an optical mouseFree if you own oneAn optical mouse that reads the moving handYour normal mouse

Software builds are free and take two minutes, but a monitoring tool can list the process. Hardware builds need no software on the work computer, but the board reports its own name when you plug it in. More on that in can a mouse jiggler be detected.

Python mouse jiggler script

This works on Windows, macOS and Linux on X11. Install the library with pip install pyautogui, save the script as jiggle.py, and run python jiggle.py. Stop it with Ctrl+C.

# jiggle.py: move the pointer 1 px right and back every 60 seconds
import time
import pyautogui

while True:
    pyautogui.moveRel(1, 0, duration=0.1)
    pyautogui.moveRel(-1, 0, duration=0.1)
    time.sleep(60)

We ran the move on macOS 26: the pointer went from x=1138 to 1139 and back to 1138. On a Mac the first run asks you to allow Terminal (or your editor) under System Settings > Privacy & Security > Accessibility. pyautogui has a fail-safe: slam the pointer into a screen corner and the script stops with an error.

On Wayland, which Ubuntu and Fedora use by default, pyautogui cannot move the pointer. Use the ydotool loop in mouse jiggler for Linux instead. A version that only runs during work hours is in script to keep Slack active.

AutoHotkey and PowerShell jigglers for Windows

If you have a Logitech G mouse, G HUB can run a similar Lua script; see Logitech mouse jiggler. With AutoHotkey v2 installed, save this as jiggle.ahk and double-click it. It shows a green H icon in the tray; right-click it and pick Exit to stop.

#Requires AutoHotkey v2.0
Persistent
SetTimer Jiggle, 60000

Jiggle() {
    MouseMove 1, 0, 0, "R"
    MouseMove -1, 0, 0, "R"
}

If you cannot install anything, PowerShell can press the F15 key every 60 seconds. F15 exists in Windows but is missing from almost every keyboard, so it does not type into your apps. It is a key press, not a mouse move, and it resets the idle timer the same way.

# press F15 every 60 seconds; stop with Ctrl+C
$shell = New-Object -ComObject WScript.Shell
while ($true) {
    $shell.SendKeys('{F15}')
    Start-Sleep -Seconds 60
}

Other PowerShell ways to block sleep, including one that uses no fake input at all, are in keep your computer awake with PowerShell. Three ready AutoHotkey v2 scripts, including an F15 press that only fires when you are idle, are in AutoHotkey script to keep your computer awake.

Arduino mouse jiggler (Leonardo or Pro Micro)

Build the Arduino jiggler: get a board with native USB, install the IDE, upload the sketch, plug it in

You need a board with the ATmega32U4 chip, which has native USB: the Arduino Leonardo, the Arduino Micro, or a Pro Micro clone. An Uno or a Nano cannot act as a USB mouse. In the Arduino IDE, select Tools > Board > Arduino Leonardo, paste the sketch, and upload.

// USB mouse jiggler: 1 px right and back every 60 seconds
#include <Mouse.h>

void setup() {
  Mouse.begin();
}

void loop() {
  Mouse.move(1, 0, 0);
  delay(50);
  Mouse.move(-1, 0, 0);
  delay(60000);
}

Plug the board into the work computer and it enumerates as a USB mouse, no driver needed. Unplug it to stop. Keep a way to reflash it: a sketch that sends mouse input nonstop can make the IDE hard to use, and the 60-second delay leaves room for that. Instructables guides use a Digispark ATtiny85 with the DigiMouse library for the same job, at a lower price and with more setup.

Never appear "away" on Slack again

Cloud-based. No downloads. Works 24/7 even when your laptop is off.

Raspberry Pi Pico jiggler (CircuitPython)

  • Hold BOOTSEL while you plug in the Pico, and copy the CircuitPython .uf2 for the Pico onto the RPI-RP2 drive.
  • From the Adafruit CircuitPython library bundle, copy the adafruit_hid folder into lib/ on the CIRCUITPY drive.
  • Save this as code.py on CIRCUITPY. It starts every time the Pico gets power.
  • # code.py: USB mouse jiggler for a Raspberry Pi Pico
    import time
    import usb_hid
    from adafruit_hid.mouse import Mouse
    
    mouse = Mouse(usb_hid.devices)
    while True:
        mouse.move(x=1)
        time.sleep(0.05)
        mouse.move(x=-1)
        time.sleep(60)

    The Pico also mounts a CIRCUITPY drive on the computer, which a data loss prevention tool may block or log. The hardware options you can buy ready-made are in the best mouse jiggler by type.

    No-code: a watch under an optical mouse

    Put an analog watch with a sweeping second hand face up, and set an optical mouse on top of it. Some optical sensors read the moving hand as movement and nudge the pointer. It depends on the mouse: many sensors see nothing through the glass, and the pointer can drift. A spare mouse on a slowly turning fan or a desk toy works on the same idea. None of these need code, and to the computer it is your own mouse.

    What a DIY jiggler does not do

  • • It keeps the Slack desktop app active wherever the pointer is, while the computer is unlocked. Not through sleep, a lock, a closed lid or on your phone.
  • • It does not hide from monitoring software. A regular 1-pixel move every 60 seconds with no keyboard input is a pattern tools such as ActivTrak and Hubstaff can flag; see can ActivTrak detect a mouse jiggler and can Hubstaff detect a mouse jiggler.
  • • It does not beat company lock policies on managed laptops that lock after a set time, whatever the input.

FAQ

Can I make a mouse jiggler at home? Yes. A 6-line Python script works on any computer, and an Arduino Pro Micro or Raspberry Pi Pico makes a plug-in USB version for about $5.

Can an Arduino Uno be a mouse jiggler? Not with the Mouse library. The Uno has no native USB. Use a Leonardo, Micro or Pro Micro.

Does a DIY mouse jiggler keep the Slack dot green? Yes for the Slack desktop app, while the computer is awake and unlocked; not through sleep, a lock, a closed lid or on your phone. The Slack desktop app counts keyboard and mouse input anywhere on the computer (Slack desktop 4.52.178 code, checked 7 Oct 2026).

Is a hardware jiggler undetectable? No. The board reports its USB name when you plug it in, and the regular movement pattern is visible to activity tools.

How do I stop the Python jiggler? Press Ctrl+C in the terminal, or move the pointer into a screen corner to trigger pyautogui's fail-safe.

Always Active

Stop Jiggling Your Mouse.

Join hundreds of remote workers who never worry about their Slack status. Set it up once, stay green forever.

Related Articles

Guide

How to See All Your DMs in Slack, Including the Hidden Ones

The DMs tab lists your direct messages with people. App DMs, Slackbot and DMs with deleted accounts sit elsewhere. We compared the tab with the full list the Slack API returned.

Slack Green Team
Guide

Slack Images Not Showing? 5 Causes We Reproduced

We uploaded images to a Slack test channel and then switched each image setting off, ran /collapse, and posted from a bot that was not in the channel. Five causes, each reproduced.

Slack Green Team
Guide

How to Message Yourself on Slack (and What It Notifies)

Your own name under Direct messages opens a private DM with yourself. We sent it a note, a file, a scheduled message and a reminder, and checked which ones raised a badge.

Slack Green Team