All Projects → jtheoof → Swappy

jtheoof / Swappy

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

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Swappy

Save Page State
A chrome extension to save the state of a page for further analysis
Stars: ✭ 208 (-21.21%)
Mutual labels:  screenshot, snapshot
Grim
Grab images from a Wayland compositor
Stars: ✭ 533 (+101.89%)
Mutual labels:  wayland, screenshot
Jsdom Screenshot
📸 Take screenshots of jsdom with puppeteer
Stars: ✭ 39 (-85.23%)
Mutual labels:  screenshot, snapshot
Singlefile
Web Extension for Firefox/Chrome/MS Edge and CLI tool to save a faithful copy of an entire web page in a single HTML file
Stars: ✭ 4,417 (+1573.11%)
Mutual labels:  screenshot, snapshot
nextshot
A simple tool for taking screenshots on Linux and sharing via Nextcloud
Stars: ✭ 37 (-85.98%)
Mutual labels:  screenshot, wayland
Ksnip
ksnip the cross-platform screenshot and annotation tool
Stars: ✭ 776 (+193.94%)
Mutual labels:  wayland, screenshot
Slurp
Select a region in a Wayland compositor
Stars: ✭ 350 (+32.58%)
Mutual labels:  wayland, screenshot
godot-engine.code-snapshot
A plugin for Godot Engine which will let you take beautified snapshots of your code within the Editor. Configure the frame as you like, with GDScript syntax already highlighted.
Stars: ✭ 32 (-87.88%)
Mutual labels:  screenshot, snapshot
jest-puppe-shots
A Jest plugin for creating screenshots of React components with a little help of Puppeteer
Stars: ✭ 86 (-67.42%)
Mutual labels:  screenshot, snapshot
video-snapshot
Get snapshots from a video file in the browser 🎥 🌅
Stars: ✭ 63 (-76.14%)
Mutual labels:  screenshot, snapshot
SingleFile-Lite
Feel the power of the Manifest V3. The future, right now!
Stars: ✭ 55 (-79.17%)
Mutual labels:  screenshot, snapshot
freeshooter
This is old-school tool for taking screenshots without bloatware features, simple as life, light as air.
Stars: ✭ 102 (-61.36%)
Mutual labels:  screenshot, snapshot
gnome-gesture-improvements
Touchpad gesture improvements for GNOME on Wayland/X11
Stars: ✭ 53 (-79.92%)
Mutual labels:  wayland
ws-screenshot
A simple way to take a screenshot of a website by providing its URL. ws-screenshot include a simple web UI but also a REST API and a Websocket API to automate screenshots.
Stars: ✭ 31 (-88.26%)
Mutual labels:  screenshot
twitch-chat-visualizer
A Node.js Project. Would you like to see your chat stream with a custom design? This is for you!
Stars: ✭ 14 (-94.7%)
Mutual labels:  screenshot
screenshot-node
Takes a screenshot of selected area and saves it to disk
Stars: ✭ 20 (-92.42%)
Mutual labels:  screenshot
puppeteer-screenshot-tester
Small library that allows us to compare screenshots generated by puppeteer in our tests.
Stars: ✭ 50 (-81.06%)
Mutual labels:  screenshot
reducer-tester
Utilities for testing redux reducers
Stars: ✭ 19 (-92.8%)
Mutual labels:  snapshot
urlbox-screenshots-node
Capture website thumbnails using the urlbox.io screenshot as a service API in node
Stars: ✭ 14 (-94.7%)
Mutual labels:  screenshot
ArcoLinux-dotfiles
ArcoLinux dotfiles for 2bwm / i3wm
Stars: ✭ 24 (-90.91%)
Mutual labels:  screenshot

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 outputing 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.

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
line_size=5
text_size=20
text_font=sans-serif
  • save_dir is where swappshots will be saved, can contain env variables and must exist in your filesystem
  • 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
  • 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

Keyboard Shortcuts

  • Ctrl+b: Toggle Paint Panel

  • b: Switch to Brush
  • t: Switch to Text
  • r: Switch to Rectangle
  • o: Switch to Ellipse
  • a: Switch to Arrow
  • d: Switch to Blur (d stands for droplet)

  • 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
  • k: Clear Paints (cannot be undone)

  • Ctrl: Center Shape (Rectangle & Ellipse) based on draw start

  • Ctrl+z: Undo
  • Ctrl+Shift+z or Ctrl+y: Redo
  • Ctrl+s: Save to file (see man page)
  • Ctrl+c: Copy to clipboard
  • Escape or q or Ctrl+w: Quit swappy

Limitations

  • Copy: If you don't have wl-clipboard installed, copy to clipboard won't work if you close swappy (the content of the clipboard is lost). This 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. For now, we use wl-copy if installed and revert to gtk clipboard if not found.
  • 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

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 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.

npx standard-version --sign
git push --follow-tags
# Do the release on Github with manual steps, then:
./script/sign-post-release

Release tarballs are signed with this PGP key: F44D05A50F6C9EB5C81BCF966A6B35DBE9442683

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].