Documentation · v0.2.0
Your screenshot,
with a point of view.
Maintained by Matteo Merola
s2 is a native screenshot annotation editor for Linux with X11. Start with an image file or a capture pipeline, add context with editable annotations, and save or copy the rendered result. This guide covers installation, every tool, keyboard controls, and configuration.
A native, keyboard-first screenshot editor for X11. Annotate, highlight, redact, and copy your capture without leaving the keyboard.
Get started
maim -s | s2 -i -
Draw a shape, then edit the selection. Ctrl+S saves and exits; Ctrl+C copies and exits. Enter only finishes text entry. In regular windows, Esc deselects; in --modal windows, Esc can cancel and quit. The ? button opens shortcut help; the info button opens About.
s2 capture.png # regular, tileable window
s2 --modal -i capture.png # request a centered floating dialog
s2 -i capture.png -o annotated.png # Ctrl+S writes this explicit path
maim -s | s2 --modal -i - -D /tmp # timestamped saves in /tmp
Without -o, Save/Ctrl+S creates YYYY-MM-DDTHHMMSS.ffffff.png in the configured save directory. Seconds and microseconds prevent minute-level collisions; exclusive file creation adds a numeric suffix if a name already exists. Explicit -o paths may be overwritten. Successful save, copy, cancellation, and WM Quit return 0; input/output failures return nonzero.
Install from GitHub
GitHub releases include fully static executables for Linux x86_64 and AArch64. Run the installer to download and verify the latest release.
curl -fsSL https://raw.githubusercontent.com/mattmezza/s2/main/install.sh | sh
To upgrade or remove the installed executable, use the same script.
curl -fsSL https://raw.githubusercontent.com/mattmezza/s2/main/install.sh | sh -s -- upgrade
curl -fsSL https://raw.githubusercontent.com/mattmezza/s2/main/install.sh | sh -s -- uninstall
The script manages $HOME/.local/bin/s2. Put $HOME/.local/bin on your PATH before /usr/local/bin if you have an older system installation. Set S2_INSTALL_DIR on the sh side of the pipe to use another absolute directory. Pass install v0.2.0 after sh -s -- to pin a version.
Running s2 requires X11. Install xclip for clipboard operations, xdg-open to open the repository link, and a capture tool such as maim if you want to select an area of the screen.
Build and install
Requires a C11 compiler, Make, CMake, Python 3 (with HTTPS support), pkg-config, X11/Xft/FreeType, Fontconfig, libpng, GLib, Pango, Cairo, and HarfBuzz. Clipboard operations use xclip; repository links use xdg-open. maim and slop are optional capture tools.
On Arch Linux:
sudo pacman -S base-devel cmake python pkgconf libx11 libxft freetype2 fontconfig libpng glib2 pango cairo harfbuzz xclip xdg-utils
# Optional capture tools:
sudo pacman -S maim slop
make
sudo make install
The default prefix is /usr/local; edit config.mk or use make PREFIX=/your/prefix install. Installation includes the executable, man page, and project, font, CUI and Clay licenses. The first make downloads CUI at the revision in cui.lock.json and verifies its SHA-256 checksum. Later builds use the local vendor/cui cache. Run make deps to fetch it ahead of time. Release source archives include CUI and can build offline.
The executable embeds Geist upright/italic variable fonts, icon masks, cursors, and the font license. It needs no adjacent asset files, API key, or installed Geist fonts. The default source build links to the system libraries above. s2 --licenses prints the embedded font license.
Draw and edit
Search the shortcut table below
| Keys | Action |
|---|---|
s, a, l, p |
Select, arrow, line, pen |
r, o, t, n |
Rectangle, circle, text, numbered pin |
h, m, b, x |
Highlight region, marker, blur, pixelate |
c |
Sample a color from the capture |
[ / ] |
Adjust the tool or selection dimension |
1–9 |
Palette foreground/stroke color |
Shift+1–Shift+9 |
Selection fill color, where supported |
f |
Toggle fill |
Shift+F |
Toggle rectangle/circle outlines |
g |
Toggle gradient fills |
Ctrl+Z / Ctrl+Shift+Z |
Undo / redo |
Delete / Backspace |
Delete selection |
Ctrl+V |
Paste text |
Ctrl+S |
Save and exit |
Ctrl+C / Ctrl+Y |
Copy and exit / copy and keep editing |
? |
Shortcut help |
Drag to draw. Shapes, strokes, pins, and committed text automatically switch to Select. Drag selected objects to move; drag empty space for a marquee selection. Reselecting Number (n) resets numbering to 1 while retaining the chosen size.
Selected objects expose square resize handles and a round rotation handle. Hold Shift while drawing for square/circular proportions, while resizing to preserve aspect ratio, or while rotating for 45° increments. Lines/arrows snap to horizontal, vertical, or diagonal while drawing with Shift.
Curves and arrow ends: drag the midpoint diamond of a selected line/arrow to bend it; Shift-drag straightens it. On selected arrows, e cycles end styles and Shift+E cycles backward. < and > toggle the start and end. Styles include open, filled, outlined, diamond, dot, and bar.
Colors and fills: the color control opens a palette with custom hex entry and image sampling. With a selection, Stroke/Text and Fill tabs choose the target; Shift-click the control opens Fill directly. Rectangles, circles, and text have independent foreground/fill colors. The two square toolbar controls toggle outline and fill independently. A dotted fill icon indicates gradients; a slashed outline icon indicates no outline. g and Shift+F update compatible selected objects and the defaults for future objects; existing unselected objects retain their appearance.
Dimensions: brackets change selected rectangle/circle outline widths by 3 px, text/number size by 8 px, marker width by 8 px, blur radius by 3 px, and highlight strength by 5 percentage points. Other stroke widths and pixelate blocks use 1 px steps. The dimension picker offers explicit values.
Text
Click with Text, type, then press Enter to commit and select it. Press t on selected text to edit in place. The single-line editor supports a caret, arrows, Home/End, Shift selection, Ctrl+A, Backspace/Delete, and paste. Esc cancels the edit; clicking outside finishes entry. Clipboard copy shortcuts export the image, not selected text.
| Selected-text keys | Action |
|---|---|
b / B |
Lower / raise font weight by 100 |
i, u, s |
Toggle italic, underline, strikethrough |
p / P |
Decrease / increase padding by 1 px |
c / C |
Decrease / increase corner radius by 4 px |
[ / ] |
Decrease / increase font size by 8 px |
1–9 / Shift+1–Shift+9 |
Foreground / background color |
Text styling keys take precedence over tool shortcuts while text is selected; choose another tool in the toolbar when needed. Defaults are Medium weight (500), 32 px size, and 12 px background padding.
View and themes
+zooms in,-zooms out, and=fits the capture (0is an alias).- Ctrl+wheel zooms around the pointer. Ctrl+left-drag pans; Fit resets panning.
- Click the footer theme name, press Alt+C, or Alt-click the color control for themes. Alt+1–9 selects Dark, Light, Tokyo Night, Gruvbox, Dracula, Nord, Catppuccin, Solarized, or Rose Pine.
- Both bars remain centered. Narrow windows wrap the tools/actions and footer details into additional rows.
- View changes and chrome never affect exported capture dimensions or pixels.


Configure
s2 reads $XDG_CONFIG_HOME/s2/config.ini at startup. If XDG_CONFIG_HOME is unset, empty, or relative, it uses ~/.config/s2/config.ini. Every setting is optional. The executable embeds the commented defaults from config.ini.
To create an editable copy from your installed version, run:
case ${XDG_CONFIG_HOME:-} in
/*) config_dir=$XDG_CONFIG_HOME/s2 ;;
*) config_dir=$HOME/.config/s2 ;;
esac
mkdir -p "$config_dir"
(set -C; s2 --print-config > "$config_dir/config.ini")
Reopen s2 to apply changes. Invalid values produce a warning and use their built-in defaults. -C and -D override the configured X11 class and save directory. An explicit -o saves to that path. If you customized config.h in an earlier version, copy those settings into the matching INI sections.
See docs/CONTROLS.md, man s2, and s2 -h for details.
Development and checks
CUI is downloaded at the exact revision in cui.lock.json; its source is cached locally and is not tracked by Git. The native X11/Cairo/Pango editor paints CUI chrome while caching capture pixels on the X server. Drawing coalesces consecutive pointer motions, retains freehand points, and uses cropped previews; final exports render at capture resolution.
make test-text test-blur
python3 tests/exit-codes.py
python3 tests/about.py
python3 tests/connectors.py
python3 tests/smoke.py
# Optional 4K motion/performance comparison:
python3 tests/motion.py
Native checks require Xvfb, xdotool, xclip, and ImageMagick's import. They run on private virtual displays, never on your desktop. The About test stubs the browser launcher. See tests/PERFORMANCE.md for measurement limitations and assets/README.md for asset provenance.
Regenerate the documentation images with python3 scripts/render_screenshots.py (also requires Pillow). It renders synthetic code on a private display; no real workspace contents are captured.
Website and releases
make site installs the locked website dependencies and builds the static Tailwind CSS site into site/dist (requires Node.js and npm). The GitHub Pages workflow builds and deploys it when main changes.
To publish a release, update VERSION in config.mk and add the matching vX.Y.Z heading to CHANGELOG.md, then commit all changes and run:
make release name=v0.2.0
This runs the native regression checks and website build, packages tracked source plus the pinned CUI dependency into an offline source archive, writes SHA-256 checksums, creates an annotated tag, pushes the branch and tag, and publishes a GitHub release. It requires GitHub CLI authentication and the test dependencies listed above. make dist creates the source archive from the current commit without publishing.
Publishing the GitHub release triggers the Static release workflow. It builds in Alpine Linux, checks the ELF for dynamic dependencies, and runs the X11 regression tests on each architecture before attaching executables, checksums, and relink archives to the release. The installer can download a new release once those assets are attached.
License
MIT © 2026 Matteo Merola. See LICENSE. Geist is distributed under the SIL Open Font License; CUI includes its own license.
The following details explain interactions that depend on context.
Window lifecycle
The default window advertises X11 NORMAL type, supports resizing/tiling, and honors WM_DELETE_WINDOW. --modal advertises DIALOG and MODAL hints, supplies a centered initial position, and lets the WM decide placement. --normal-window remains a compatibility alias for the default. -C overrides WM_CLASS without changing these modes.
Esc in a regular window cancels pending input and interactions, closes transient UI, switches to Select, and clears selection. Esc in a modal window first dismisses transient UI/text entry; otherwise it cancels and quits. About dismisses on Esc without quitting in either mode. q and WM Quit cancel with status 0. A deliberate forced X11 kill/server disconnect remains an external termination.
Enter commits text or applies a custom hex color; it never saves an image. Ctrl+S and Save commit pending input and save/exit. An explicit -o path is honored; otherwise a local-time timestamp with seconds and six microsecond digits is used. Timestamp creation is exclusive, with numeric collision suffixes. -D overrides the timestamp directory and must be absolute. An explicit output path retains overwrite semantics.
Ctrl+C commits pending input and copies/exits; Ctrl+Y copies without exiting. -c requests copying when finishing successfully; cancellation skips output. Real load/save/copy errors return nonzero.
Selection and appearance
New annotations are selected automatically. Clicking an object selects it; dragging empty canvas creates a marquee, including objects that intersect it. Dragging a selected member moves the group. Shift constrains movement to one axis. Delete removes selected objects.
Square handles resize; Shift preserves aspect ratio. Text and pins always resize proportionally. The round handle rotates; Shift snaps to 45°. Comma/period rotate by 15°. </> rotate by 1° except on selected arrows, where they toggle start/end decorations.
The midpoint diamond curves lines/arrows; Shift-drag straightens them. Arrow end styles cycle with e and reverse with E. The configured cycle uses IDs 0=open, 1=filled triangle, 2=outlined triangle, 3=diamond, 4=dot, 5=bar.
Brackets and the dimension picker edit selected objects directly: stroke width, text/pin size, marker width, highlight strength, blur radius, or pixelate block size. Rectangle/circle outline steps are 3 px; text/pins 8 px; marker 8 px; highlight 5 percentage points; blur 3 px. Unsupported fill-color operations are ignored.
Plain palette numbers apply foreground/stroke color to colorable selections. Shift+numbers apply independent fill colors to rectangles, circles and text, enabling fill. The color picker exposes matching Stroke/Text and Fill tabs, custom hex input, and image sampling. Shift-click opens its Fill target. Text reserves c/C for corner radius, so use the color control for sampling while text is selected.
f controls fill; Shift+F independently controls rectangle/circle outlines. g controls gradients on rectangles, circles, text backgrounds, number pins, highlights, and filled arrow ends. Each updates compatible selected actions and the current default for future actions. The outline and fill toolbar icons show these states. Turning both rectangle/circle fill and outline off intentionally produces an invisible object that remains selectable. Chrome gradients are separate from annotation gradients.
Text entry
The editor is single-line. Enter commits and selects; t on selected text reopens it in place. Typing, UTF-8 navigation, Home/End, Shift selection, Ctrl+A, Backspace/Delete and paste are supported. Mouse clicking finishes entry rather than positioning a caret. Esc restores an existing edited object or cancels a new one. Committing empty replacement text deletes that object.
Selected-text shortcuts override tool shortcuts: b/B weight, i italic, u underline, s strikethrough, p/P padding, c/C corner radius, and brackets font size. Palette and picker controls preserve the other typography properties.
Footer and dialogs
Theme, zoom and Fit controls stay accessible in narrow windows; information moves to a second footer row. The question-mark button opens help. The info button opens a themed, responsive About card with version, attribution and license. Its repository link invokes xdg-open with the literal HTTPS URL. Tab/Shift+Tab navigate the repository and return button; Enter/Space activate the focused control. Close, backdrop click and Esc dismiss it. Dialogs block annotation and export shortcuts behind them.