Check Mouse DPI

Change Mouse DPI Linux

Set your mouse DPI on any Linux distribution using xinput, libinput, or desktop environment settings. Generate ready-to-paste terminal commands for Ubuntu, Fedora, Arch, and Debian.

Ubuntu · Fedora · Arch · Any distro
Linux DPI Command Generator
LINUX
0.0
-1.0 (Slow) 0.0 (Default) 1.0 (Fast)
Generated Commands
# Loading...

Note: Run xinput list first to find your mouse device ID.

Setting Mouse DPI with xinput on Linux

xinput is the primary command-line tool for configuring input devices on X11-based Linux systems.

xinput reads and writes properties of input devices connected to your Linux system. To change mouse behavior, first identify your device ID, then modify the relevant properties. The tool works on any Linux distribution running X11 — Ubuntu, Fedora, Arch, Debian, Mint, Pop!_OS, and Manjaro.

List All Input Devices

Displays all connected input devices with their IDs. Find your mouse name and note the device ID number (e.g., 'id=12').

xinput list

View Device Properties

Shows all configurable properties for the device, including acceleration speed, acceleration profile, coordinate transformation matrix, and natural scrolling.

xinput list-props <device-id>

Set Pointer Speed

Sets the acceleration speed. Range is -1.0 (slowest) to 1.0 (fastest). A value of 0.0 provides default speed. This does not change hardware DPI but adjusts the software sensitivity multiplier.

xinput set-prop <device-id> 'libinput Accel Speed' 0.0

Configuring DPI Through libinput

libinput is the modern input handling library used by both X11 and Wayland on Linux.

libinput replaced the older evdev and synaptics drivers as the default input handler for most Linux distributions starting with Ubuntu 18.04, Fedora 25, and Arch Linux. It provides 2 acceleration profiles (flat and adaptive) and a speed adjustment range from -1.0 to 1.0.

FormulaEffective Speed = Hardware DPI × libinput Speed Multiplier × Flat/Adaptive Curve

Flat Acceleration Profile

Enables the flat profile (no acceleration). Cursor speed is linearly proportional to mouse movement — the closest thing to 'raw input' on Linux. The second value '1' selects the flat profile.

xinput set-prop <device-id> 'libinput Accel Profile Enabled' 0 1

Adaptive Acceleration Profile

Enables the adaptive profile (acceleration based on speed). Slow movements are precise, fast movements are faster. Default on most distributions.

xinput set-prop <device-id> 'libinput Accel Profile Enabled' 1 0

Custom Speed with Flat Profile

Combines the flat profile with a custom speed value. Negative values reduce cursor speed. Useful for high-DPI mice (1600+) where the cursor is too fast with default settings.

xinput set-prop <device-id> 'libinput Accel Speed' -0.5

Persistent DPI Settings Across Reboots

xinput commands reset after each reboot. There are 3 methods to make mouse DPI settings permanent on Linux.

Method 1: Xorg Configuration File

Create /etc/X11/xorg.conf.d/50-mouse.conf with your desired options. This file is loaded on every X11 startup. Use 'Option "AccelSpeed" "0.0"' and 'Option "AccelProfile" "flat"' for consistent raw input.

Method 2: Desktop Autostart Script

Add your xinput commands to ~/.config/autostart/ as a .desktop file. This runs the commands after login. Works on GNOME, KDE Plasma, XFCE, and Cinnamon desktop environments.

Method 3: udev Rules (Advanced)

Create a udev rule in /etc/udev/rules.d/ that triggers a script when your specific mouse is connected. Useful for per-device configuration when you use multiple mice.

Desktop Environment Mouse Settings (GNOME, KDE, XFCE)

Each Linux desktop environment provides a graphical mouse configuration panel with different options.

GNOME (Ubuntu, Fedora)

Settings → Mouse & Touchpad → Mouse Speed slider. 'Natural Scrolling' toggle. No acceleration profile selector — GNOME uses adaptive acceleration by default. Use gsettings or dconf-editor for hidden options.

KDE Plasma (Kubuntu, Fedora KDE)

System Settings → Input Devices → Mouse → Pointer Speed slider. Acceleration profile dropdown (Flat / Adaptive / None). KDE provides the most GUI options for mouse configuration among Linux desktops.

XFCE (Xubuntu, Manjaro XFCE)

Settings Manager → Mouse and Touchpad → Devices tab. Acceleration slider (1.0–10.0). Sensitivity slider. XFCE uses libinput or evdev depending on the distribution version.

Wayland vs X11 DPI Configuration

Wayland and X11 handle mouse input differently. The tools and commands change depending on your display server.

X11 (Xorg)

Uses xinput for runtime configuration and xorg.conf files for persistent settings. All mouse properties are accessible and modifiable. Most gaming setups on Linux use X11 for compatibility.

Wayland (GNOME, KDE 6)

xinput does not work on Wayland. Mouse configuration is handled through the compositor settings. GNOME Wayland uses gsettings commands. KDE Wayland uses System Settings GUI. libinput still provides the underlying input processing.

Wayland Configuration Commands

On GNOME Wayland, use 'gsettings set org.gnome.desktop.peripherals.mouse speed 0.0' to adjust speed and 'gsettings set org.gnome.desktop.peripherals.mouse accel-profile flat' to disable acceleration.

Gaming on Linux with Custom DPI

Gaming on Linux requires specific DPI configuration for Steam, Proton, Wine, and native Linux games.

Steam on Linux supports both X11 and Wayland sessions. Proton (Steam's Windows compatibility layer) passes mouse input through the Wine translation layer. Raw input support depends on the game engine and the Proton version. Native Linux games using SDL2 can read input directly from libinput.

CS2 and Source 2 on Linux

Counter-Strike 2 runs natively on Linux. Set m_rawinput 1 in console to bypass OS mouse settings. DPI is read directly from the sensor. Pointer acceleration has zero effect when raw input is enabled.

Proton Games (Windows via Steam)

Games running through Proton use Wine's input translation. Set the flat acceleration profile in libinput before launching. Some Proton games respect raw input; others fall back to the OS cursor — test each game individually.

Lutris and Wine Games

Games launched through Lutris or standalone Wine use the X11 cursor by default. Disable acceleration at the system level before launching. DXVK and VKD3D do not affect mouse input handling.

Frequently Asked Questions

Common questions about setting mouse DPI on Linux with xinput, libinput, and desktop environment settings.

01How do I find my mouse device ID on Linux?

Run 'xinput list' in a terminal. The output shows all connected input devices with their names and IDs. Your mouse appears as something like 'Logitech G Pro' or 'Razer DeathAdder' with 'id=12'. Use this ID number in xinput commands.

02Can I change hardware DPI on Linux without manufacturer software?

Not through Linux system tools. xinput and libinput change software sensitivity, not hardware sensor DPI. To change hardware DPI, use manufacturer software on Windows (most brands don't offer Linux software), set the DPI via onboard memory, or use the physical DPI button on the mouse.

03How do I disable mouse acceleration on Ubuntu?

On X11: run 'xinput set-prop <device-id> "libinput Accel Profile Enabled" 0 1' to enable the flat (no acceleration) profile. On Wayland: run 'gsettings set org.gnome.desktop.peripherals.mouse accel-profile flat'. Both commands take effect immediately.

04Do xinput settings persist after reboot?

No. xinput settings are runtime-only and reset on reboot. To make them persistent, create an Xorg config file at /etc/X11/xorg.conf.d/50-mouse.conf or add xinput commands to a desktop autostart script in ~/.config/autostart/.

05Does Logitech G HUB work on Linux?

No. Logitech G HUB does not have a Linux version. Use Solaar (open-source Logitech device manager) for basic DPI configuration on Linux. Solaar supports DPI changes for many Logitech mice via the HID++ protocol. For full feature parity, set DPI in G HUB on Windows and save to onboard memory.

06What is the difference between flat and adaptive acceleration profiles?

Flat profile provides linear, proportional cursor movement — 2 inches of travel always produces the same cursor distance regardless of speed. Adaptive profile applies velocity-dependent acceleration — fast movements produce proportionally more cursor distance. Flat is preferred for gaming; adaptive is comfortable for desktop use.

07How do I configure mouse DPI on Wayland?

xinput does not work on Wayland. Use GNOME Settings GUI or 'gsettings set org.gnome.desktop.peripherals.mouse speed <value>' for GNOME Wayland. Use System Settings → Input Devices → Mouse for KDE Plasma Wayland. libinput handles the underlying input processing on both.

08Can I set different DPI profiles for different mice on Linux?

Yes. xinput commands target specific device IDs, so you can set different acceleration and speed values for each connected mouse. For persistent per-device settings, create udev rules in /etc/udev/rules.d/ that trigger device-specific scripts when a mouse is connected.