需先安装 meson、wayland、cairo、libxkbcommon 等依赖才能编译;scdoc 为可选依赖,不装则无 man 手册;必须在 Wayland 会话下运行,无法在纯 X11 环境使用
meson setup build
ninja -C build
build/slurp 硬件要求按 README 说明
README 未说明硬件要求;需运行在 Wayland 合成器环境中,未提及 GPU 或显存要求
Wayland 下的区域选择工具,把框选结果输出到标准输出,常与 grim 截图配合使用
Wayland 下的命令行区域选择工具,用鼠标框选屏幕区域并输出坐标,常配合截图、录屏工具使用。
核心能力
- 在 Wayland 合成器中交互式框选区域并打印坐标
- 支持 -p 选择单点而非区域
- 支持 -o 选择输出并用 -f 格式化输出名称
- 可读取 stdin 传入候选区域,配合 swaymsg 与 jq 选窗口
容易踩的坑
内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README
- v1.5.01.5.0最新正式版2023-12-14 · 2023-12-14 10:56 UTC
这个版本没有写更新说明。
- v1.4.01.4.02022-12-05 · 2022-12-05 12:02 UTC
这个版本没有写更新说明。
- v1.3.21.3.22021-04-17 · 2021-04-17 17:39 UTC
这个版本没有写更新说明。
- v1.3.11.3.12020-11-05 · 2020-11-05 11:21 UTC
这个版本没有写更新说明。
- v1.3.01.3.02020-10-16 · 2020-10-16 15:03 UTC
这个版本没有写更新说明。
用户点评
登录用户的真实使用记录,可按版本和硬件筛选共 0 条
还没有人点评。第一个说出真实体验的人最有价值。
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