Sweets

Usage

Take, select, and mark up screenshots

sweetshot region          # select a rectangle
sweetshot output          # output of the focused window
sweetshot output DP-1     # a named output
sweetshot window          # focused window

By default a shot is saved as a PNG and copied to the clipboard. The saved path is printed on stdout.

output without a name falls back to the first output if Sweets can't be asked for the focused window. window captures the window focused when sweetshot started, without its border.

Reference

CommandDoes
regionSelect a rectangle, then capture it
output [NAME]Capture a whole output
windowCapture the focused window
OptionDoes
--fileSave to a file only
--clipCopy to the clipboard only
--dir <path>Save to another directory. Must be absolute
--cursorInclude the pointer
--editMark up the shot before saving
Exit codeMeaning
0Done
1Failed, also partly
2Usage error or unknown output
3Cancelled

Region selector

The screen freezes while you select, so menus and tooltips stay in the shot.

InputAction
DragSelect
Drag inside the selectionMove it
ClickWhole output. Outside a selection, clear it
ArrowsMove by 1 px. Ctrl: 10 px
Shift+ArrowsResize by 1 px. Ctrl: 10 px
TabNext output
PShow or hide the pointer
EnterCapture
EscCancel

Editor

--edit opens the shot in an editor before saving. It works with every command.

sweetshot region --edit

Drag to draw, Enter saves, Esc cancels. The toolbar does the same as the keys. Tab hides it.

Keys are physical positions on a US layout.

KeyAction
A, L, R, EArrow (default), line, rectangle, ellipse
D, H, XPen, highlighter, pixelate
NNumbered badge. Click to place
FFill rectangles and ellipses
1–9Red, orange, yellow, green, blue, purple, pink, white, black
- / =, wheelThinner / thicker
Shift while drawing45° lines, squares, circles
Right button while drawingDrop the shape
Ctrl+ZUndo
Ctrl+Shift+Z, Ctrl+YRedo

Saving

Shots go to Screenshots inside your pictures directory:

  1. $XDG_PICTURES_DIR/Screenshots
  2. XDG_PICTURES_DIR from user-dirs.dirs, plus /Screenshots
  3. ~/Pictures/Screenshots

The directory is created if missing. Use --dir to pick another one.

Files are never overwritten or left half-written.

  • On Linux this needs O_TMPFILE: ext4, btrfs, xfs, and tmpfs work. vfat, exFAT, and most FUSE mounts are refused.
  • On FreeBSD the file is written under a hidden .sweetshot-*.tmp name and renamed when complete. A crash in between can leave that file behind.
  • On FAT, the mount sets the file's permissions.

On this page