A Linux palm rejection filter for touchpads, written in Rust.
Many Linux touchpad drivers don't provide adequate palm rejection, causing accidental touches when typing or resting your palms on the touchpad edges. This tool addresses that by filtering out touches that begin in configurable exclusion zones.
Photo credit: Lattice Point
Some users resort to applying duct tape and aluminum foil to physically block portions of their touchpad (conductive material is required since regular tape won't prevent capacitive touch sensors from detecting input). unpalm provides the same functionality in software - defining exclusion zones without the need for physical modifications.
Existing solutions have significant limitations:
- libinput's palm detection requires hardware support and isn't configurable - you either get the automatic detection or nothing
- xinput/Synaptics tools are X11-only and don't work on Wayland, which is becoming the standard
- Windows has Touchpad Blocker, macOS has BetterTouchTool - but Linux lacked a comparable cross-platform solution
- Driver-specific settings (Synaptics, ELAN) vary by hardware and aren't portable across machines
unpalm solves these problems by working at the evdev level, making it compatible with any display server, any compositor, and any touchpad hardware.
- Works everywhere - Compatible with X11, Wayland, and any compositor (sway, Hyprland, GNOME, KDE, etc.)
- Truly configurable - Unlike libinput's automatic-only approach, customize margins and exclusion zones to your needs
- Custom polygon zones - Unique capability to define arbitrary shapes (perfect for corner triangles or complex layouts)
- Smart per-touch tracking - Only blocks touches that start in exclusion zones, not those that move into them
- Hardware independent - Works with any touchpad via evdev, no driver-specific dependencies
- Lightweight - Single ~300KB binary with no runtime dependencies
- Systemd integration - Run as a user or system service for automatic palm rejection on boot
| Feature | unpalm | libinput palm detection | xinput/Synaptics | Touchpad Blocker (Windows) | BetterTouchTool (macOS) |
|---|---|---|---|---|---|
| Wayland support | ✅ Yes | ✅ Yes | ❌ No (X11 only) | N/A | N/A |
| X11 support | ✅ Yes | ✅ Yes | ✅ Yes | N/A | N/A |
| Configurable zones | ✅ Margins + polygons | ❌ Automatic only | ✅ Yes | ✅ Yes | |
| Custom polygon zones | ✅ Yes | ❌ No | ❌ No | ❌ No | |
| Hardware independent | ✅ Any evdev device | ❌ Driver-specific | ✅ Yes | ✅ Yes | |
| Per-touch tracking | ✅ Yes | ✅ Yes | ❌ No (coord-based) | ||
| Runtime dependencies | ❌ None | ||||
| Binary size | ~300KB | Part of libinput | N/A | ~2MB | ~15MB |
Key differentiators:
- unpalm is the only Linux solution that combines Wayland support, configurable polygon zones, and hardware independence
- Unlike libinput, you have full control over exclusion zones instead of relying on automatic detection
- Unlike xinput-based tools, it works on modern Wayland compositors (sway, Hyprland, etc.)
- Linux with evdev support
- Access to input devices (
inputgroup membership, or root)
Note: sudo is not generally needed to run unpalm. On most systems, the udev ACL rule (80-uinput.rules) grants the input group access to /dev/uinput. On systems where this rule is not present, sudo may still be required.
From crates.io:
cargo install unpalmArch Linux (AUR):
yay -S unpalm
# or
paru -S unpalmFrom source:
git clone https://github.com/rpodgorny/unpalm.git
cd unpalm
cargo build --release
sudo cp target/release/unpalm /usr/local/bin/Run with default settings (auto-detect touchpad, built-in exclusion zones):
unpalmThe tool will auto-detect your touchpad and create a filtered virtual device.
With no arguments, unpalm blocks touches starting in these zones:
left 30% right 30%
(triangle) (triangle)
+----------------------------------------+
|########################################|
|########################################| <- top 20% (rectangle)
|#########/ \#########|
|#######/ \#######|
|#####/ OK \#####|
|###/ \###|
|##/ \##|
|#/ \#|
|/ OK \|
| |
+----------------------------------------+
# = blocked zone OK = usable area
The default zones are a top 20% rectangle plus left/right 30% triangles. The triangles are wide at the top (where the top rectangle meets them) and taper to a point at the bottom corners. This shape works well because palms typically rest at the edges near the top of the touchpad.
When any --margin-* or --polygon argument is given, all defaults are replaced - only the explicitly specified zones apply. The --margin-* flags always produce rectangles; use --polygon for triangles or other shapes.
| Option | Description |
|---|---|
-n, --device-name <PATTERN> |
Device name pattern with wildcard support (e.g., *ELAN*4448) |
-f, --device-file <PATH> |
Device file path (e.g., /dev/input/event5) |
--margin-left <PERCENT> |
Left margin as percentage of touchpad width (rectangle) |
--margin-right <PERCENT> |
Right margin as percentage of touchpad width (rectangle) |
--margin-top <PERCENT> |
Top margin as percentage of touchpad height (rectangle) |
--margin-bottom <PERCENT> |
Bottom margin as percentage of touchpad height (rectangle) |
--polygon <POINTS> |
Polygon exclusion zone (format: "x1,y1 x2,y2 x3,y3" where x,y are percentages 0-100) |
Note: With no arguments, built-in defaults apply (30% side triangles + 20% top rectangle). When any --margin-* or --polygon is specified, all defaults are replaced. All coordinates are percentages (0-100) of the touchpad's width/height, making configurations portable across different touchpad sizes.
Auto-detect touchpad with default exclusion zones:
unpalmSpecify touchpad by name pattern:
unpalm -n "*Synaptics*"Custom rectangular margins (30% left/right, 15% top, 10% bottom):
unpalm --margin-left 30 --margin-right 30 --margin-top 15 --margin-bottom 10left 30% right 30%
(rectangle) (rectangle)
+----------------------------------------+
|########################################| <- top 15% (rectangle)
|##########| |##########|
|##########| |##########|
|##########| usable area |##########|
|##########| |##########|
|##########| |##########|
|########################################| <- bottom 10% (rectangle)
+----------------------------------------+
Only a custom triangular exclusion zone (no defaults):
# Triangle at top-left corner (coordinates are percentages: 0-100)
unpalm --polygon "0,0 20,0 10,30"Multiple polygon zones:
# Two triangles at top corners (all coordinates are percentages 0-100)
unpalm \
--polygon "0,0 15,0 0,25" \
--polygon "85,0 100,0 100,25"top-left 15x25% top-right 15x25%
triangle triangle
+----------------------------------------+
|######/ \######|
|####/ \####|
|##/ \##|
|/ \|
| |
| usable area |
| |
| |
+----------------------------------------+
Specify exact device file:
unpalm -f /dev/input/event5For automatic palm rejection on boot, install as a systemd user service (recommended) or system service. See INSTALL.md for detailed instructions.
- The tool grabs the physical touchpad device (making it unavailable to other applications)
- Creates a virtual touchpad device with identical capabilities
- Monitors all touch events from the physical device
- Blocks individual touches that start within exclusion zones
- Forwards all other events to the virtual device
- Applications interact with the filtered virtual device instead
Touches are tracked per-slot, so if you start a touch in an allowed area, it continues to work even if you move into an exclusion zone. This provides natural palm rejection without interfering with normal touchpad use.
For transparency and completeness, here are related projects and approaches:
Linux:
- libinput palm detection - Built-in automatic palm detection (requires hardware support)
- touchpadtuner - GUI for configuring xinput touchpad settings (X11 only)
Other platforms:
- Touchpad Blocker - Palm rejection for Windows
- BetterTouchTool - Comprehensive macOS gesture and input customization tool
Why unpalm exists: None of the Linux solutions above offer configurable, polygon-based exclusion zones that work on both X11 and Wayland without hardware dependencies.
This project was built to solve a specific, immediate problem: the ASUS Zenbook Duo keyboard's palm rejection doesn't work in detached mode, making it nearly unusable. It was developed quickly and pragmatically - function over form. It works well in practice, but the codebase prioritizes directness over elaborate abstraction. Contributions and improvements are welcome.
- INSTALL.md - Detailed installation and systemd service setup
