百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
N

niri-float-sticky

> 编程语言
开源

一个实用程序,可在 niri 中的所有工作区中显示浮动窗口,类似于其他合成器中的"粘贴窗口"。

100 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

一个实用程序,可在 niri 中的所有工作区中显示浮动窗口,类似于其他合成器中的"粘贴窗口"。

Niri Float Sticky

A utility to make floating windows visible across all workspaces in niri — similar to "sticky windows" in other compositors.

Why?

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.

Installation

Via Go:

bash
go install github.com/probeldev/niri-float-sticky@latest

Via AUR (maintained by jamlotrasoiaf/brainworms2002):

bash
paru -S niri-float-sticky

Via Nix:

bash
nix profile install github:probeldev/niri-float-sticky 

Via XBPS - Void Linux (maintained by Soulful Sailer):

bash
xbps-install niri-float-sticky

Usage

To automatically launch the utility on niri startup, add this line to your niri configuration:

kdl
spawn-at-startup "niri-float-sticky"

Command Line Options

bash
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 exit

Notes:

  • -app-id and -title can 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:

bash
niri-float-sticky -debug >> /tmp/niri-float-sticky.log

# Configuring logrotate
cat /dev/null
/tmp/niri-float-sticky.log {
    daily
    rotate 5
    compress
    missingok
    notifempty
    copytruncate
    maxsize 10M
    su root root
}
EOF

IPC

niri-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.

How It Works

The binary has two modes:

  1. Daemon mode (default) Runs the event loop and listens for IPC commands.

  2. Client mode (-ipc) Sends a command to the running daemon and exits immediately.

Available IPC Commands

bash
niri-float-sticky -ipc set_sticky
niri-float-sticky -ipc unset_sticky
niri-float-sticky -ipc toggle_sticky
  • set_sticky — force window to be sticky
  • unset_sticky — remove manual override
  • toggle_sticky — toggle sticky state

Example: Keybinding in niri

You can bind stickiness toggling to a key:

binds {
    Mod+G { 
        spawn "niri-float-sticky" "-ipc" "toggle_sticky"; 
    }
}

Implementation Details

The IPC protocol uses a JSON message over a UNIX domain socket:

json
{
  "action": "toggle_sticky",
  "window_id": 123456
}

Contributing

We welcome all contributions! To get started:

  1. Open an Issue to:

    • Report bugs
    • Suggest new features
    • Ask questions
  2. Create a Pull Request for:

    • Bug fixes
    • New functionality
    • Documentation improvements

License

This project is licensed under the MIT License.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Goniri

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言