sun
sun is an OCaml executable to take screenshot from the command line in Wayland, using grim
and slurp
.
Installation
sun
can be installed with opam:
opam install sun
If you don't have opam
, you can install it following the how to install opam guide.
If you can't or don't want to use opam
, consult the opam file for build instructions.
Quickstart
Taking a screenshot is as simple as:
$ sun
screenshot saved at /home/doratheexplorer/img/20230124_20h01m04s_sun.png
The output file can be specified like this:
$ sun /tmp/cheese.png
screenshot saved at /tmp/cheese.png
By default, the XDG Base Directory Specification and xdg-user-dirs are used to compute the output directory. It will be the XDG_PICTURES_DIR
value in ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs
.
You can overwrite this by writing a configuration file for sun
in ${XDG_CONFIG_HOME:-~/.config}/sun/config.scfg
with the following content:
output_dir /home/winniethepooh/screenshots
You can use environment variables this way:
output_dir $(HOME)/screenshots