docs(swappy): add man and readme

This commit is contained in:
Jeremy Attali 2019-12-27 19:56:05 -05:00
parent 8abc5d52ec
commit 08787f3136
2 changed files with 96 additions and 4 deletions

View File

@ -1,11 +1,69 @@
# swappy
A Wayland native snapshot tool, inspired by Snappy on macOS
A Wayland native snapshot tool, inspired by Snappy on macOS. Works great with [slurp] and [sway].
## Configuration
Code was largely inspired by [grim].
If you are using [Sway](https://github.com/swaywm/sway), it is recommended to set Swappy as a floating window. To do this, add the following line to your sway config file:
## Example usage
Swappshot a region:
```sh
swappy -g "100,100 200x200"
```
for_window [app_id="swappy"] floating enable
Select a region and swappshot it:
```sh
swappy -g "$(slurp)"
```
Grab a swappshot from a specific window under Sway, using `swaymsg` and `jq`:
```sh
swappy -g "$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' | slurp)"
```
## Package manager installation
### Arch Linux User Repository
Assuming [yay](https://aur.archlinux.org/packages/yay/) as your AUR package manager.
* stable version: `yay -S swappy`
* git version: `yay -S swappy-git`
## Building from source
Install dependencies:
* meson
* wayland
* cairo
* gtk
Optional dependencies:
* libnotify
Then run:
```sh
meson build
ninja -C build
```
To run directly, use `build/swappy`, or if you would like to do a system
installation (in `/usr/local` by default), run `ninja -C build install`.
## Contributing
Pull requests are welcome.
## License
MIT
[slurp]: https://github.com/emersion/slurp
[grim]: https://github.com/emersion/grim
[sway]: https://github.com/swaywm/sway

View File

@ -0,0 +1,34 @@
swappy(1)
# NAME
swappy - grab and edit on the fly snapshots of a Wayland compositor, inspired by Snappy on macOS
# DESCRIPTION
*swappy* [options...]
# SYNOPSIS
swappy is a command-line utility to take and edit screenshots of Wayland desktops. For now
it requires support for the screencopy protocol to work. Support for the
xdg-output protocol is optional, but improves fractional scaling support.
swappy will save the swappshot images to a timestamped file name in
*$XDG_DESKTOP_DIR*. If this variable is not set, it will revert to: *$XDG_CONFIG_HOME/Desktop*.
If *$XDG_CONFIG_HOME* is not set, it will revert to: *$HOME/Desktop*.
# OPTIONS
*-h*
Show help message and quit.
*-g* "<x>,<y> <width>x<height>"
Set the region to capture, in layout coordinates.
This is slurp friendly.
# AUTHORS
Written and maintained by Jeremy Attali <jeremy.attali@gmail.com>. See
https://github.com/jtheoof/swappy.