A utility to make floating windows visible across all workspaces in niri — similar to "sticky windows" in other compositors.
Niri doesn’t natively support global floating windows. This tool forces float windows to persist on every workspace, mimicking the sticky behavior from X11/Wayland compositors like Sway or KWin.
go install github.com/probeldev/niri-float-sticky@latestVia AUR (maintained by jamlotrasoiaf/brainworms2002):
paru -S niri-float-stickynix profile install github:probeldev/niri-float-sticky To automatically launch the utility on niri startup, add this line to your niri configuration:
spawn-at-startup "niri-float-sticky"Usage of niri-float-sticky:
-allow-moving-to-foreign-monitors
allow moving to foreign monitors
-app-id value
only move floating windows with app-id matching given patterns
-debug
enable debug logging
-disable-auto-stick
disable auto sticking for all windows
-ipc string
send IPC command to daemon: set_sticky, unset_sticky, toggle_sticky
-title value
only move floating windows with title matching this pattern
-version
print version and exitNotes:
-app-idand-titlecan be provided multiple times to specify different patterns.- Each flag accepts regex, so you can also provide multiple patterns in one flag (e.g.
foo|bar). - Internally all patterns are combined into a single regex with alternatives
Example with debug log:
niri-float-sticky -debug >> /tmp/niri-float-sticky.log
# Configuring logrotate
cat <<EOF | sudo tee /etc/logrotate.d/niri-float-sticky >/dev/null
/tmp/niri-float-sticky.log {
daily
rotate 5
compress
missingok
notifempty
copytruncate
maxsize 10M
su root root
}
EOFniri-float-sticky exposes a simple UNIX socket IPC interface to control window stickiness at runtime.
The daemon creates a socket at:
$XDG_RUNTIME_DIR/niri-float-sticky.sock
This allows external commands (for example, keybindings) to toggle stickiness of the currently focused window.
The binary has two modes:
-
Daemon mode (default) Runs the event loop and listens for IPC commands.
-
Client mode (
-ipc) Sends a command to the running daemon and exits immediately.
niri-float-sticky -ipc set_sticky
niri-float-sticky -ipc unset_sticky
niri-float-sticky -ipc toggle_stickyset_sticky— force window to be stickyunset_sticky— remove manual overridetoggle_sticky— toggle sticky state
You can bind stickiness toggling to a key:
binds {
Mod+G {
spawn "niri-float-sticky" "-ipc" "toggle_sticky";
}
}
The IPC protocol uses a JSON message over a UNIX domain socket:
{
"action": "toggle_sticky",
"window_id": 123456
}We welcome all contributions! To get started:
-
Open an Issue to:
- Report bugs
- Suggest new features
- Ask questions
-
Create a Pull Request for:
- Bug fixes
- New functionality
- Documentation improvements
This project is licensed under the MIT License.