LinuxCommandLibrary

unclutter

Hide the mouse cursor after inactivity

TLDR

Hide mouse cursor after 3 seconds

$ unclutter -idle [3]
copy

SYNOPSIS

unclutter [options]

PARAMETERS

-idle
    Sets the inactivity timeout in seconds before the cursor hides. The default is typically 5 seconds.

-root
    Forces the cursor to hide even when it is positioned over the root window (desktop background), which is often visible by default.

-jitter
    Defines a small movement threshold in pixels. If the cursor moves less than this amount, it is still considered 'idle' for the timeout, preventing accidental revelations from minor vibrations.

-grab
    Grabs the X pointer, giving unclutter exclusive control. Use with caution as this can prevent other applications (like some games or remote desktop clients) from obtaining the pointer.

-display
    Specifies the X display to connect to (e.g., ':0.0') if not the default.

-noevents
    Prevents the generation of pointer motion events when the cursor is revealed, which can prevent unwanted interactions with certain applications.

-md
    Specifies a modifier key (e.g., 'Control', 'Shift') that, when held down, keeps the cursor visible and prevents it from hiding.

DESCRIPTION

unclutter is a simple yet effective utility for the X Window System that automatically hides the mouse cursor after a period of inactivity. This is particularly useful in environments where a static cursor might be distracting or obstruct content, such as during video playback, presentations, or when using full-screen applications. When the mouse is moved, unclutter instantly makes the cursor visible again.

It operates quietly in the background, consuming minimal system resources. Its primary purpose is to enhance the user experience by reducing visual clutter and allowing for a more immersive view, ensuring that the cursor only appears when actively needed for interaction. It's a common tool for minimalist desktop setups or dedicated media machines.

CAVEATS

unclutter is designed specifically for the X Window System and will not function under Wayland, which uses a different display protocol. The -grab option should be used with care, as it can conflict with applications that also require exclusive control of the pointer. While generally low, resource usage might slightly increase if the -jitter value is set extremely low on systems with highly sensitive pointing devices, as it requires more frequent checks for minute movements. Compatibility might vary with certain desktop environments or window managers that implement their own cursor management policies.

AUTOSTART CONFIGURATION

Users commonly configure unclutter to launch automatically with their X session. This can be achieved by adding the command to startup scripts like .xinitrc or .xsession, or through the autostart mechanisms provided by specific desktop environments (e.g., GNOME, KDE, XFCE).

WAYLAND COMPATIBILITY

It's important to note that unclutter is fundamentally incompatible with the Wayland display server protocol. Wayland employs a different architectural approach for input and display management, requiring native Wayland compositors or specific Wayland-native utilities to achieve similar cursor hiding functionality.

HISTORY

unclutter is a long-standing utility within the Xorg ecosystem, embodying the Unix philosophy of doing one task exceptionally well. Originally authored by Daniel D. Clark, it has seen continued maintenance by various contributors, reflecting its enduring utility for X11 users. Its core functionality has remained largely consistent since its inception, as its purpose is straightforward. While its relevance has somewhat lessened with the advent and growing adoption of Wayland (which requires different solutions for cursor management), unclutter remains a widely available and used tool for managing the mouse cursor on X Window System desktops.

SEE ALSO

xautolock(1), xscreensaver(1), xset(1)

Copied to clipboard