stutter
A focus-aware process priority daemon.
When you switch windows, stutter automatically raises the CPU priority of the focused process and restores the previous one. This reduces input latency and makes the active window feel more responsive under load.
How it works
stutter connects to your compositor's IPC socket and listens for focus change events. On each focus change it calls setpriority(2) to set the focused process to nice -5 and resets the previously focused process back to 0. On exit, the last focused process is restored to the default priority.
Supported backends
- Hyprland
- Niri
Configuration
The configuration file is located at ~/.config/stutter/config.toml. It is
automatically created with default values on the first run.
# CPU priority of the focused window (lower = higher priority, min -20)
= -5
# CPU priority of all other windows (restored when window loses focus)
= 0
# Per-app overrides (optional)
# The key is the window class or app_id
[]
= { = -10 }
= { = -2 }
You can reload the configuration without restarting the daemon by sending a
SIGHUP signal:
# or via systemd
Requirements
- Permission to lower nice values - either run as root, or grant the binary
CAP_SYS_NICE:
sudo setcap cap_sys_nice+ep /usr/bin/stutter
Installation
AUR (recommended)
# or
Pre-built binary
From source
# or build manually:
Setup
Grant permissions (pick one)
# Option A - capability (recommended)
# Option B - run as root (not recommended)
Autostart
systemd (recommended):
# AUR install — service is already in place:
# Manual install — copy service file first:
hyprland.conf:
exec-once = stutter
niri (config.kdl):
spawn-at-startup "stutter"
License
MIT