Skip to content

b0o/snag

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

snag version license: MIT

snag screenshots and screencasts in sway

Demo

demonstration screencast

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 <service> --upload Upload the output file.
                        <service> may be one of: drop, imgur (image only)

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

  -D <ms>      --delay  Delay capture for <ms> 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>,<y> <width>x<height>"
                        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> --dir        Save the screenshot in <dir>.
                        Default: current working directory.

  -n <name>    --name   Use <name> 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 <format> --namef   Use <format> 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>,<y>_<width>x<height>".

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 <github.com/b0o>

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

License

© 2020-2022 Maddison Hellstrom

Released under the MIT License.