slurp

emersionMIT更新放缓

Wayland 下的命令行区域选择工具,用鼠标框选屏幕区域并输出坐标,常配合截图、录屏工具使用。

Select a region in a Wayland compositor

v1.5.0发布于 2023-12-14 10:56 UTC1,302star78fork同步于 2026-11-07 07:33 UTC

怎么上手

由 README 提炼,执行前请确认
meson setup build
ninja -C build
build/slurp
硬件要求按 README 说明

README 未说明硬件要求;需运行在 Wayland 合成器环境中,未提及 GPU 或显存要求

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

Wayland 下的区域选择工具,把框选结果输出到标准输出,常与 grim 截图配合使用

Wayland 下的命令行区域选择工具,用鼠标框选屏幕区域并输出坐标,常配合截图、录屏工具使用。

核心能力

  • 在 Wayland 合成器中交互式框选区域并打印坐标
  • 支持 -p 选择单点而非区域
  • 支持 -o 选择输出并用 -f 格式化输出名称
  • 可读取 stdin 传入候选区域,配合 swaymsg 与 jq 选窗口

容易踩的坑

需先安装 meson、wayland、cairo、libxkbcommon 等依赖才能编译;scdoc 为可选依赖,不装则无 man 手册;必须在 Wayland 会话下运行,无法在纯 X11 环境使用

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v1.5.0
  1. v1.5.01.5.0最新正式版2023-12-14 · 2023-12-14 10:56 UTC

    这个版本没有写更新说明。

  2. v1.4.01.4.02022-12-05 · 2022-12-05 12:02 UTC

    这个版本没有写更新说明。

  3. v1.3.21.3.22021-04-17 · 2021-04-17 17:39 UTC

    这个版本没有写更新说明。

  4. v1.3.11.3.12020-11-05 · 2020-11-05 11:21 UTC

    这个版本没有写更新说明。

  5. v1.3.01.3.02020-10-16 · 2020-10-16 15:03 UTC

    这个版本没有写更新说明。

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    slurp

    Select a region in a Wayland compositor and print it to the standard output. Works well with grim.

    Join the IRC channel: #emersion on Libera Chat.

    Building

    Install dependencies:

    • meson
    • wayland
    • cairo
    • libxkbcommon
    • scdoc (optional: man pages)

    Then run:

    git clone https://github.com/emersion/slurp
    cd slurp
    meson setup build
    ninja -C build
    build/slurp
    

    Example usage

    Select a region and print it to stdout:

    slurp
    

    Select a single point instead of a region:

    slurp -p
    

    Select an output and print its name:

    slurp -o -f "%o"
    

    Select a window under Sway, using swaymsg and jq:

    swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' | slurp
    

    Select a window without border under Sway, using swaymsg and jq:

    swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | "\(.rect.x+.window_rect.x),\(.rect.y+.window_rect.y) \(.window_rect.width)x\(.window_rect.height)"' | slurp
    

    Contributing

    Either send GitHub pull requests or send patches on the mailing list.

    License

    MIT