Back to Blog
Guide

Mouse Jiggler for Linux: Free xdotool and ydotool Scripts

The free Linux mouse jiggler is a short loop: xdotool on X11 or ydotool on Wayland moves the pointer 1 pixel and back every minute. If you only need the screen to stay on, an inhibitor is cleaner. The Slack desktop app counts the movement anywhere on screen.

Slack Green Team
September 25, 2026
October 8, 2026
7 min read
Share:
mouse jiggler
linux
ubuntu
xdotool
slack status

The free mouse jiggler for Linux is a short shell loop. On an X11 session, xdotool mousemove_relative moves the pointer 1 pixel and back every 60 seconds. That counts as input, so the screen does not blank, lock or suspend. On Wayland, which Ubuntu and Fedora use by default with GNOME, xdotool cannot reach the desktop, so use ydotool, which writes to the kernel input device /dev/uinput. Run echo $XDG_SESSION_TYPE first to see which one you have. If you only want the screen to stay on, you do not need fake input at all: gnome-session-inhibit or the Caffeine extension does that.

A jiggler keeps the Slack desktop app green 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), so the nudge helps Slack wherever the pointer sits.

Linux mouse jiggler options compared

MethodWorks onKeeps the screen onChat status
xdotool loopX11 onlyYesApps that read system idle, such as teams-for-linux and the Slack desktop app: yes, wherever the pointer is
ydotool loopX11 and WaylandYesSame as xdotool
Python with pynput (the jiggler package, small Tkinter apps on GitHub)X11; on Wayland only XWayland appsOn X11Same as xdotool
gnome-session-inhibit, CaffeineGNOME, any sessionYesNo input, so apps still go idle
USB hardware jigglerAnyYesSame as xdotool, and it needs no software
Paid AppImage apps (mouse-jiggler.org, MoveIt)X11; Wayland through ydotoolYesSame as xdotool

The Arkane Mouse Jiggler that most Windows guides name does not run on Linux. For Windows see Mouse Jiggler for Windows, and for macOS see mouse jiggler for Mac.

Mouse jiggler on Ubuntu with xdotool (X11)

Install xdotool from the distro repository. It is in Ubuntu, Debian, Fedora and Arch:

sudo apt install xdotool        # Ubuntu, Debian, Mint
sudo dnf install xdotool        # Fedora
sudo pacman -S xdotool          # Arch

Save this as jiggle.sh, make it executable with chmod +x jiggle.sh, and run it with ./jiggle.sh. Stop it with Ctrl+C.

#!/usr/bin/env bash
# jiggle.sh: move the pointer 1 px right and back every 60 seconds (X11)
while true; do
  xdotool mousemove_relative -- 1 0
  xdotool mousemove_relative -- -1 0
  sleep 60
done

The -- matters. Without it, xdotool reads -1 as an option and the move back fails. A relative move of one pixel there and back leaves the pointer where it was, so it does not get in the way when you come back to the keyboard.

We tested the loop on 2026-09-25 in an Ubuntu 24.04 container with the Xvfb X server and xdotool 3.20160805.1, the version Ubuntu 24.04 ships. The X idle time, read with xprintidle, fell from about 2,000 ms to 137 ms right after each nudge, and the pointer stayed at 640,400.

Test: a 1 px xdotool nudge resets X idle time, Ubuntu 24.04, Xvfb, xdotool 3.20160805.1

One trap from the same test: xprintidle 0.2.5 on Ubuntu 24.04 reset the idle counter each time we called it. A script that asks xprintidle whether you are idle before it jiggles keeps resetting the timer it reads, so the plain fixed loop above is the safer choice.

To start the loop at login, add it to Startup Applications in GNOME or Mint, or create ~/.config/autostart/jiggle.desktop with Exec=/home/you/jiggle.sh.

Mouse jiggler on Wayland with ydotool

xdotool talks to the X server. On a Wayland session it reaches only apps that run under XWayland, and the desktop's idle timer does not see its moves, so the screen still locks. Where no X display is set at all, it fails at once. This is what xdotool printed on 4 October in an Ubuntu 24.04 container with no X server:

$ xdotool mousemove_relative -- 1 0
Error: Can't open display: (null)
Failed creating new xdo instance

ydotool creates a virtual input device through the kernel (/dev/uinput), so it works on Wayland, on X11 and even on the text console. The catch is that distros ship two incompatible versions. We installed it on each one in a container on 4 October:

Distroydotool versionxdotool versionJiggle command that works
Ubuntu 22.040.1.83.20160805.1ydotool mousemove 1 0
Ubuntu 24.040.1.83.20160805.1ydotool mousemove 1 0
Ubuntu 25.100.1.83.20160805.1ydotool mousemove 1 0
Debian 13 (trixie)not in the main repository3.20160805.1build ydotool from source, or use xdotool on X11
Fedora 441.0.4not testedstart ydotoold, then ydotool mousemove -x 1 -y 0

On Ubuntu's 0.1.8, mousemove <x> <y> moves by that many pixels and needs no daemon:

$ sudo ydotool mousemove 1 0
ydotool: notice: ydotoold backend unavailable (may have latency+delay issues)
$ echo $?
0

"ydotoold backend unavailable" is a notice, not an error. The exit code was 0 and the move went through the slower direct path. You can ignore it in a jiggle loop.

On Fedora's 1.0.4 the same command fails until the daemon runs:

$ ydotool mousemove 1 0
failed to connect socket `/tmp/.ydotool_socket': No such file or directory
Please check if ydotoold is running.
$ echo $?
2

With ydotoold started, its help lists mousemove [-x <xpos> -y <ypos>] [-- <xpos> <ypos>], and adds -a for absolute moves. Use -x 1 -y 0 there; the bare 1 0 form from older guides is not in the 1.x usage line. Check ydotool mousemove --help on your own machine before you write the loop.

The loop is the same as the xdotool one, with the ydotool command inside. To avoid sudo, give your user access to /dev/uinput with a udev rule, or run ydotoold as a systemd service. Both give every program you run the power to type on your behalf, so do not do this on a machine you do not own.

Never appear "away" on Slack again

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

Keep Linux from going idle without a jiggler

If the goal is a screen that stays on during a build, a download or a video call, block the idle timer instead of faking input:

# keep the GNOME session awake for as long as the command runs
gnome-session-inhibit --inhibit idle --inhibit suspend sleep 3600

# block suspend on any systemd distro while a job runs
systemd-inhibit --what=sleep:idle ./long-job.sh

# X11 only: turn off the screen saver and screen power saving
xset s off -dpms

The Caffeine GNOME extension puts the same inhibit behind a top-bar toggle (how to install and set it up). None of these create input, so chat apps still mark you away after their own timer. The settings route, with GNOME, KDE and Mint menus, is in how to stop Ubuntu from locking the screen. For other systems see how to stop your computer from sleeping.

Does a Linux mouse jiggler keep Slack and Teams active?

Slack: yes, while the screen is unlocked. The desktop app reads the system idle time every 10 seconds (Slack desktop 4.52.178 code, checked 7 Oct 2026), so a nudge anywhere on the screen counts, the same way it resets the screen lock timer. With no input, Slack's help says you go away after 10 minutes. We read that code on a Mac and ran our xdotool test in an X11 container; we have not timed Slack on a Wayland desktop, so test ydotool there before you rely on it. Does Slack track mouse movement explains what the app reads. The Linux specifics are in keep Slack active on Linux.

Teams: depends on the client. Microsoft retired the Teams desktop app for Linux at the end of 2022. The unofficial teams-for-linux app reads system idle time, so a system-wide jiggle keeps it Available. Teams in a browser tab is less predictable, so test it for 10 minutes before you rely on it. The Windows behaviour is in does a mouse jiggler work for Teams.

Screen lock, suspend and most activity trackers: yes, they see the moves as input.

Can IT detect a mouse jiggler on Linux?

Yes, if they look. The script shows up in ps as xdotool or ydotool every minute, ydotool adds a virtual input device that libinput list-devices lists, and the pattern (1 pixel every 60 seconds, no clicks, no typing) is easy to spot in any activity log. A USB jiggler shows up as a new HID device. How each kind is found is in can a mouse jiggler be detected, and the policy side in is it illegal to use a mouse jiggler.

If the only goal is a green dot in Slack, Slack Green keeps you active while the computer is off, asleep, locked or closed, with no software or hardware on the computer. The other options are compared in the best mouse jiggler.

FAQ

Is there a mouse jiggler for Ubuntu?

Yes. The free one is a 5-line xdotool loop on X11, or ydotool on Wayland. Paid AppImage apps also exist.

Why does my xdotool jiggler do nothing?

You are probably on Wayland. Run echo $XDG_SESSION_TYPE. If it prints wayland, use ydotool, or, on Ubuntu 24.04 and earlier, log in with "Ubuntu on Xorg" from the gear icon on the login screen.

Does xdotool work on Wayland?

Only for apps that run under XWayland. The desktop's idle timer does not see its moves, so the screen still locks.

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