swappy

jtheoofMIT活跃维护

Wayland 原生的截图编辑工具,灵感来自 macOS 的 Snappy,可对截取的画面直接添加标注和涂改,解决 Wayland 桌面下缺少顺手截图编辑器的痛点。

A Wayland native snapshot editing tool, inspired by Snappy on macOS

v1.8.0发布于 2025-08-27 19:35 UTC1,516star +2 / 7 天64fork同步于 2026-11-10 17:50 UTC

怎么上手

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

README 未说明硬件要求;这是 Wayland 桌面下的 GTK 应用,需在 Wayland 合成器上运行,未提及 GPU 或显存要求

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

项目说明

由 README 自动翻译提炼

Wayland 原生的截图标注编辑工具,把 grim、slurp 抓到的图直接管道进来画完再输出

Wayland 原生的截图编辑工具,灵感来自 macOS 的 Snappy,可对截取的画面直接添加标注和涂改,解决 Wayland 桌面下缺少顺手截图编辑器的痛点。

核心能力

  • 从 stdin 读取图像,用 -f - 直接接收 grim 等工具输出
  • 内置画笔、文字、矩形、椭圆、箭头、模糊、裁剪七种标注模式
  • 支持撤销重做、保存到文件、复制到剪贴板
  • 用 -o - 把编辑结果输出到 stdout,可继续管道给 pngquant 等工具
  • 通过 GLib conf 配置文件定制保存目录、文件名格式、默认画笔与颜色

容易踩的坑

图标依赖 Font Awesome 5,Arch 上需装 otf-font-awesome,否则画笔图标显示异常;输出格式只支持 PNG;未安装 wl-clipboard 时关闭 swappy 后剪贴板内容会丢失;1.8.0 及更早版本在平铺合成器上默认浮动,新版本需自行加 app_id=swappy 的浮动窗口规则

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

最近发版

5 个版本v1.8.0
  1. v1.8.0最新正式版2025-08-27 · 2025-08-27 19:35 UTC

    1.8.0 (2025-08-27)

    Features

    • config: add left hand friendly keybinds (e3b8bf6)
    • ui: add transparency feature (0416812)
    • ui: support input method when edit text (5e3808c)
    • ui: text supports pasting using Ctrl-v (59dca02)

    Bug Fixes

    • application: bring back output option (061155c), closes #202
    • application: save twice if auto_save and -o option (e5cde68)
  2. v1.7.12025-08-18 · 2025-08-18 02:00 UTC
    查看更新说明

    1.7.1 (2025-08-18)

    Bug Fixes

    • render: fix drawing transparent images (49f84fd)
  3. v1.7.02025-08-18 · 2025-08-18 00:58 UTC
    查看更新说明

    1.7.0 (2025-08-18)

    Features

    • auto saving on quit app (72a511c)
    • config: custom_color config option (726159d)
    • i18n: add zh_CN locale (9e7f3b2)

    Bug Fixes

    • config: fix segfault at exit (182322d)
    • ui: add non-versioned fontawesome (3941fec)

    1.6.0 (2025-08-18)

    Features

    • auto saving on quit app (72a511c)
    • config: custom_color config option (726159d)
    • i18n: add zh_CN locale (9e7f3b2)

    Bug Fixes

    • config: fix segfault at exit (182322d)
    • ui: add non-versioned fontawesome (3941fec)
  4. v1.5.12022-11-20 · 2022-11-20 21:55 UTC
    查看更新说明

    1.5.1 (2022-11-20)

    Bug Fixes

    • ui: use *-symbolic variant of toolbar icons (5dc44f8), closes #34

    New Contributors

  5. v1.5.01.5.02022-11-18 · 2022-11-18 21:35 UTC
    查看更新说明

    1.5.0 (2022-11-18)

    Features

    • config: add early_exit option (60da549)
    • config: allow paint_mode to be configured through config file (2f35f02)
    • config: try to create save_dir if it does not exist (4fb291a)
    • ui: allow filling rectangles and ellipsis (8ee55f7), closes #120

    New Contributors

    Full Changelog: https://github.com/jtheoof/swappy/compare/v1.4.0...v1.5.0

用户点评

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

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

    README 原文

    未翻译

    swappy

    A Wayland native snapshot and editor tool, inspired by Snappy on macOS. Works great with grim, slurp and sway. But can easily work with other screen copy tools that can output a final image to stdout. See below.

    Screenshot

    Swappy Screenshot

    Example usage

    Output of grim (or any tool outputting an image file):

    grim -g "$(slurp)" - | swappy -f -
    

    Swappshot a PNG file:

    swappy -f "~/Desktop/my-gnome-saved-file.png"
    

    Print final surface to stdout (useful to pipe with other tools):

    grim -g "$(slurp)" - | swappy -f - -o - | pngquant -
    

    Grab a swappshot from a specific window under Sway, using swaymsg and jq:

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

    Config

    The config file is located at $XDG_CONFIG_HOME/swappy/config or at $HOME/.config/swappy/config.

    If no user config exists, swappy falls back to swappy/config in each directory listed in $XDG_CONFIG_DIRS (default: /etc/xdg/swappy/config). This lets distributions ship a system-wide default. Only the first file found is loaded: a user config replaces the system one entirely, keys are not merged.

    The file follows the GLib conf format. See the man page for details. There is example config file here.

    The following lines can be used as swappy's default:

    [Default]
    save_dir=$HOME/Desktop
    save_filename_format=swappy-%Y%m%d-%H%M%S.png
    show_panel=false
    show_decorations=true
    line_size=5
    text_size=20
    text_font=sans-serif
    paint_mode=brush
    early_exit=false
    fill_shape=false
    auto_save=false
    custom_color=rgba(193,125,17,1)
    transparent=false
    transparency=50
    
    • save_dir is where swappshots will be saved, can contain env variables, when it does not exist, swappy attempts to create it first, but does not abort if directory creation fails
    • save_filename_format: is the filename template, if it contains a date format, this will be parsed into a timestamp. Format is detailed in strftime(3). If this date format is missing, filename will have no timestamp
    • show_panel is used to toggle the paint panel on or off upon startup
    • show_decorations is used to toggle the toolbar, window decorations and image gutter on or off upon startup (setting it to false leaves only the image, use keyboard shortcuts to edit). The --no-decorations command-line option does the same for a single run, overriding the config
    • line_size is the default line size (must be between 1 and 50)
    • text_size is the default text size (must be between 10 and 50)
    • text_font is the font used to render text, its format is pango friendly
    • paint_mode is the mode activated at application start (must be one of: brush|text|rectangle|ellipse|arrow|blur|crop, matching is case-insensitive)
    • early_exit is used to make the application exit after saving the picture or copying it to the clipboard
    • fill_shape is used to toggle shape filling (for the rectangle and ellipsis tools) on or off upon startup
    • auto_save is used to toggle auto saving of final buffer to save_dir upon exit
    • custom_color is used to set a default value for the custom color
    • transparency is used to set transparency of everything that is drawn during startup
    • transparent is used to toggle transparency during startup

    Tiling window managers

    The swappy window can be resized, and the image scales to fit it. On tiling compositors such as Sway and Hyprland, this means swappy opens as a regular tiled window.

    Swappy 1.8.0 and earlier opened with a fixed size. Tiling compositors float fixed-size windows automatically, so swappy used to open floating without any configuration.

    To keep swappy floating, add a window rule that matches its app id, swappy:

    Sway (~/.config/sway/config):

    for_window [app_id="swappy"] floating enable
    

    Hyprland (Lua config, ~/.config/hypr/hyprland.lua):

    hl.window_rule({ match = { class = "^(swappy)$" }, float = true })
    

    Other compositors usually have an equivalent rule that matches on app id.

    Keyboard Shortcuts

    • Ctrl+b: Toggle Paint Panel
    • b: Switch to Brush
    • e t: Switch to Text (Editor)
    • r s: Switch to Rectangle (Square)
    • o: Switch to Ellipse (Circle)
    • a: Switch to Arrow
    • d: Switch to Blur (d stands for droplet)
    • c: Switch to Crop
    • R: Use Red Color
    • G: Use Green Color
    • B: Use Blue Color
    • C: Use Custom Color
    • Minus: Reduce Stroke Size
    • Plus: Increase Stroke Size
    • Equal: Reset Stroke Size
    • f: Toggle Shape Filling
    • x k: Clear Paints (cannot be undone)
    • T: Toggle Transparency
    • Ctrl: Center Shape (Rectangle, Ellipse & Blur) based on draw start
    • Shift: Constrain Shape to Square (Rectangle & Blur) or Circle (Ellipse)
    • Ctrl+z: Undo
    • Ctrl+Shift+z or Ctrl+y: Redo
    • Ctrl+s: Save to file (see man page)
    • Ctrl+Shift+s: Save to file with a "Save As" dialog
    • Ctrl+c: Copy to clipboard
    • Escape or q or Ctrl+w: Quit swappy

    Limitations

    • Copy: While swappy is open, the copied image is offered in every image format GTK supports (image/png, image/bmp, image/tiff, ...), so applications that need a format other than PNG (e.g. Remmina) can paste it. When swappy exits, it hands the image to wl-copy, as PNG only. If you don't have wl-clipboard installed, the clipboard is lost when you close swappy. This is because GTK 3.24 has not implemented persistent storage on wayland backend yet. We need to do it on the Wayland level, or wait for GTK 4.
    • Fonts: Swappy relies on Font Awesome 5 being present to properly render the icons. On Arch you can simply install those with: sudo pacman -S otf-font-awesome
    • Output Format: Only PNG is supported.

    Installation

    Building from source

    Install dependencies (on Arch, name can vary for other distros):

    • meson
    • ninja
    • cairo
    • pango
    • gtk
    • glib2
    • scdoc

    Optional dependencies:

    • wl-clipboard (to make sure the copy is saved if you close swappy)
    • otf-font-awesome (to draw the paint icons properly)

    Then run:

    meson setup build
    ninja -C build
    

    i18n

    This section is for developers, maintainers and translators.

    To add support to a new locale or when translations are updated:

    1. Update src/po/LINGUAS (when new locales are added)
    2. Generate a new po file (ignore and do not commit potential noise in other files):
    ninja -C build swappy-update-po
    

    To rebuild the base template (should happen less often):

    ninja -C build swappy-pot
    

    See the meson documentation for details.

    Contributing

    Pull requests are welcome. This project uses conventional commits to automate changelog generation.

    Release

    We rely on standard-version which is part of the JavaScript ecosystem but works well with any project.

    ./script/github-release
    

    Make sure everything is valid in the Draft release, then publish the draft.

    Release tarballs are signed with this PGP key: F44D05A50F6C9EB5C81BCF966A6B35DBE9442683

    License

    MIT