8000 GitHub - gabm/Satty at v0.19.0
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

gabm/Satty

Repository files navigation

Satty: Modern Screenshot Annotation.

Satty is a screenshot annotation tool inspired by Swappy and Flameshot.

Satty has been created to provide the following improvements over existing screenshot annotation tools:

  • very simple and easy to understand toolset (like Swappy)
  • fullscreen annotation mode and post shot cropping (like Flameshot)
  • extremely smooth rendering thanks to HW acceleration (OpenGL)
  • working on wlroots based compositors (Sway, Hyprland, River, ...)
  • minimal, modern looking UI, thanks to GTK and Adwaita
  • be a playground for new features (post window selection, post paint editing, ...)

Install

Thanks to our package maintainers, Satty is available for many distributions on Linux and BSD:

Packaging status

Arch Linux

You can get the official Arch Linux package from the AUR:

pacman -S satty

Gentoo

You can get the Gentoo package from the Guru overlay:

eselect repository enable guru
emerge --sync guru
emerge -av satty

Pending PR for Gentoo overlay: gentoo/gentoo#33908

Alpine Linux

Satty is available in Alpine Community. You can install it by uncommenting the community repo in /etc/apk/repositories and then run:

apk add satty

Prebuilt Sources

You can download a prebuilt binary for x86-64 on the Satty Releases page.

Usage

Start by providing a filename or a screenshot via stdin and annotate using the available tools. Save to clipboard or file when finished. Tools and Interface have been kept simple.

All configuration is done either at the config file in XDG_CONFIG_DIR/.config/satty/config.toml or via the command line interface. In case both are specified, the command line options always override the configuration file.

Shortcuts

  • Enter: as configured (see below), default: copy-to-clipboard
  • Esc: as configured (see below), default: exit
  • Ctrl+C: Save to clipboard
  • Ctrl+S: Save to specified output file
  • Ctrl+T: Toggle toolbars
  • Ctrl+Y: Redo
  • Ctrl+Z: Undo

Tool Modifiers

  • Arrow: Hold Shift to make arrow snap to 15° steps
  • Ellipse: Hold Alt to center the ellipse around origin, hold Shift for a circle
  • Highlight: Hold Ctrl to switch between block and freehand mode (default configurable, see below), hold Shift for a square
  • Line: Hold Shift to make line snap to 15° steps
  • Rectangle: Hold Alt to center the rectangle around origin, hold Shift for a square
  • Text: Press Shift+Enter to insert line break, combine Ctrl with Left or Right for word jump or Ctrl with Backspace or Delete for word delete

Configuration File

[general]
# Start Satty in fullscreen mode
fullscreen = true
# Exit directly after copy/save action
early-exit = true
# Draw corners of rectangles round if the value is greater than 0 (0 disables rounded corners)
corner-roundness = 12
# Select the tool on startup [possible values: pointer, crop, line, arrow, rectangle, text, marker, blur, brush]
initial-tool = "brush"
# Configure the command to be called on copy, for example `wl-copy`
copy-command = "wl-copy"
# Increase or decrease the size of the annotations
annotation-size-factor = 2
# Filename to use for saving action. Omit to disable saving to file. Might contain format specifiers: https://docs.rs/chrono/latest/chrono/format/strftime/index.html
output-filename = "/tmp/test-%Y-%m-%d_%H:%M:%S.png"
# After copying the screenshot, save it to a file as well
save-after-copy = false
# Hide toolbars by default
default-hide-toolbars = false
# The primary highlighter to use, the other is accessible by holding CTRL at the start of a highlight [possible values: block, freehand]
primary-highlighter = "block"
# Disable notifications
disable-notifications = false
# Actions to trigger on right click (order is important)
# [possible values: save-to-clipboard, save-to-file, exit]
actions-on-right-click = []
# Actions to trigger on Enter key (order is important)
# [possible values: save-to-clipboard, save-to-file, exit]
actions-on-enter = ["save-to-clipboard"]
# Actions to trigger on Escape key (order is important)
# [possible values: save-to-clipboard, save-to-file, exit]
actions-on-escape = ["exit"]
# Action to perform when the Enter key is pressed [possible values: save-to-clipboard, save-to-file]
# Deprecated: use actions-on-enter instead
action-on-enter = "save-to-clipboard"
# Right click to copy
# Deprecated: use actions-on-right-click instead
right-click-copy = false
# request no window decoration. Please note that the compositor has the final say in this. At this point. requires xdg-decoration-unstable-v1.
no-window-decoration = true
# experimental feature: adjust history size for brush input smooting (0: disabled, default: 0, try e.g. 5 or 10)
brush-smooth-history-size = 10

# Font to use for text annotations
[font]
family = "Roboto"
style = "Bold"

# Custom colours for the colour palette
[color-palette]
# These will be shown in the toolbar for quick selection
palette = [
    "#00ffff",
    "#a52a2a",
    "#dc143c",
    "#ff1493",
    "#ffd700",
    "#008000",
]

# These will be available in the color picker as presets
# Leave empty to use GTK's default
custom = [
    "#00ffff",
    "#a52a2a",
    "#dc143c",
    "#ff1493",
    "#ffd700",
    "#008000",
]

Command Line

» satty --help
Modern Screenshot Annotation.

Usage: satty [OPTIONS] --filename <FILENAME>

Options:
  -c, --config <CONFIG>
          Path to the config file. Otherwise will be read from XDG_CONFIG_DIR/satty/config.toml
  -f, --filename <FILENAME>
          Path to input image or '-' to read from stdin
      --fullscreen
          Start Satty in fullscreen mode
  -o, --output-filename <OUTPUT_FILENAME>
          Filename to use for saving action or '-' to print to stdout. Omit to disable saving to file. Might contain format specifiers: <https://docs.rs/chrono/latest/chrono/format/strftime/index.html>
      --early-exit
          Exit directly after copy/save action
      --corner-roundness <CORNER_ROUNDNESS>
          Draw corners of rectangles round if the value is greater than 0 (Defaults to 12) (0 disables rounded corners)
      --initial-tool <TOOL>
          Select the tool on startup [aliases: init-tool] [possible values: pointer, crop, line, arrow, rectangle, ellipse, text, marker, blur, highlight, brush]
      --copy-command <COPY_COMMAND>
          Configure the command to be called on copy, for example `wl-copy`
      --annotation-size-factor <ANNOTATION_SIZE_FACTOR>
          Increase or decrease the size of the annotations
      --save-after-copy
          After copying the screenshot, save it to a file as well Preferably use the `action_on_copy` option instead
      --actions-on-enter <ACTIONS_ON_ENTER>
          Actions to perform when pressing Enter [possible values: save-to-clipboard, save-to-file, exit]
      --actions-on-escape <ACTIONS_ON_ESCAPE>
          Actions to perform when pressing Escape [possible values: save-to-clipboard, save-to-file, exit]
      --actions-on-right-click <ACTIONS_ON_RIGHT_CLICK>
          Actions to perform when hitting the copy Button [possible values: save-to-clipboard, save-to-file, exit]
  -d, --default-hide-toolbars
          Hide toolbars by default
      --font-family <FONT_FAMILY>
          Font family to use for text annotations
      --font-style <FONT_STYLE>
          Font style to use for text annotations
      --primary-highlighter <PRIMARY_HIGHLIGHTER>
          The primary highlighter to use, secondary is accessible with CTRL [possible values: block, freehand]
      --disable-notifications
          Disable notifications
      --profile-startup
          Print profiling
      --no-window-decoration
          Disable the window decoration (title bar, borders, etc.)
      --right-click-copy
          Right click to copy. Preferably use the `action_on_right_click` option instead
      --action-on-enter <ACTION_ON_ENTER>
          Action to perform when pressing Enter. Preferably use the `actions_on_enter` option instead [possible values: save-to-clipboard, save-to-file, exit]
      --no-window-decoration
          Request no window decoration. Please note that the compositor has the final say in this. At this point. requires xdg-decoration-unstable-v1.
      --brush-smooth-history-size <SIZE>
          Experimental feature: Adjust history size for brush input smooting (0: disabled, default: 0, try e.g. 5 or 10)
  -h, --help
          Print help
  -V, --version
          Print version

wlroots based compositors (Sway, Wayfire, River, ...)

You can bind a key to the following command:

grim -g "$(slurp -o -r -c '#ff0000ff')" -t ppm - | satty --filename - --fullscreen --output-filename ~/Pictures/Screenshots/satty-$(date '+%Y%m%d-%H:%M:%S').png

Hyprland users must escape the # with another #:

grim -g "$(slurp -o -r -c '##ff0000ff')" -t ppm - | satty --filename - --fullscreen --output-filename ~/Pictures/Screenshots/satty-$(date '+%Y%m%d-%H:%M:%S').png

Please note we're using ppm in both examples. Compared to png, ppm is uncompressed and this can save time.

Other examples

Image Resize

Satty does not provide a resize mechanism other than cropping. But you can pipe the result to other tools such as ImageMagick:

grim -g "0,0 3840x2160" -t ppm - | satty --filename - --output-filename - | convert -resize 50% - out.png

Build from source

You first need to install the native dependencies of Satty (see below) and then run:

# build release binary, located in ./target/release/satty
make build-release

# optional: install to /usr/local
PREFIX=/usr/local make install

# optional: uninstall from /usr/local
PREFIX=/usr/local make uninstall

Dependencies

Satty is based on GTK-4 and Adwaita.

Ubuntu

  • libgtk-4-1
  • libadwaita-1-0
  • libepoxy
  • fontconfig

Arch Linux & Gentoo

  • glib2
  • libadwaita
  • gtk4
  • gdk-pixbuf2
  • libepoxy
  • fontconfig

Maintainers and Contributors

Satty wouldn't exist without the help of our contributors and maintainers. Current maintainers are @RobertMueller2 (maintainer), @fabienjuif (maintainer) and @gabm (maintainer, original author). Our contributors are:

Made with contrib.rocks.

Star History

Star History Chart

License

The source code is released under the MPL-2.0 license.

The Font 'Roboto Regular' from Google is released under Apache-2.0 license.

0