An open API service indexing awesome lists of open source software.

https://github.com/b0o/snag

📸 snag screenshots and screencasts in Sway
https://github.com/b0o/snag

rofi screencast screencasts screenshot snag snag-screenshots sway swaywm wayland

Last synced: about 1 year ago
JSON representation

📸 snag screenshots and screencasts in Sway

Awesome Lists containing this project

README

          

# snag [![version](https://img.shields.io/github/v/tag/b0o/snag?style=flat&color=yellow&label=version&sort=semver)](https://github.com/b0o/snag/releases) [![license: MIT](https://img.shields.io/github/license/b0o/snag?style=flat&color=green)](https://opensource.org/licenses/MIT)

> snag screenshots and screencasts in sway

## Demo

![demonstration screencast](./assets/demo-01.gif)

## Install

TODO

## Usage

```
snag v0.1.2 (github.com/b0o/snag)

Usage: snag [opts] [-- [pass-thru opts ..]]

Options:
General:
-h --help Print this help message.
-v --version Print program version.

-x --copy-path After snagging a screenshot, copy the output file path
to the clipboard using wl-copy.

-N --notify Send a notification with the snag result on exit.

-U --upload Upload the output file.
may be one of: drop, imgur (image only)

-R --rofi Use rofi as an interactive snag UI.

-D --delay Delay capture for milliseconds.

Capture Mode:
-I [format] --image Capture a still image using grim.
This is the default mode.
[format] may be one of: png (default), jpeg, ppm.

-V [format] --video Capture a video using wf-recorder.
[format] may be one of: mp4 (default), gif, webm.

Capture Quality:

--grim-quality Set the grim JPEG filetype quality 0-100. Defaults to 80.

--grim-level Set the grim PNG filetype compression level 0-9. Defaults to 6.

Capture Region:
If none of the following options are specified, the focused output will be
captured by default.

-r [region] --region Capture a rectangular region.
[region] is of the form ", x"
If [region] is not specified, the user will be able to
select it graphically with the mouse via the slurp
utility.

-c [id] --container Capture a container.
[id] is a sway container ID.
If [id] is not specified, the user will be able to
select the target container graphically with the mouse.
If [id] is a the string 'foc' or 'focused', the
focused container will be used.

-w [name] --workspace Capture a workspace.
[name] is a sway workspace name.
If [name] is not specified, the user will be able to
select the target workspace graphically with the mouse.
If [name] is a the string 'foc' or 'focused', the
focused workspace will be used.

-o [output] --output Capture an output.
[output] is a wayland output name.
If [output] is not specified, the user will be able to
select the target output graphically with the mouse.
If [output] is a the string 'foc' or 'focused', the
focused output will be used.

-a --all Capture all outputs.

Output File:

-d --dir Save the screenshot in .
Default: current working directory.

-n --name Use as the literal output file name.
The default file name will be generated by the -f
format of "%Y-%m-%d_%H-%M-%S_{desc}.{ext}"

-f --namef Use to construct the output filename.

Sequences recognised by date(1) or the following will
be interpolated:

{ext} the file extension as set in the -I / -V opts
(without a leading .).

{desc} a description of what was selected:
- if a region was selected: "region"
- if a container was selected:
- wayland apps: container's app_id
- xwayland apps: container's class
- if an output was selected: its name
- if all outputs were selected: "all"

{region} the captured region's coordinates, of the
form ",_x".

To pass on arguments to the capture command (grim or wf-recorder), a -- can be
passed after the final snag argument and any remaining arguments will be passed
through to the capture command.

(c) 2020-2022 Maddison Hellstrom

License: MIT (https://mit-license.org/)
```

## License

© 2020-2022 Maddison Hellstrom

Released under the MIT License.