Page
Library
Module
Module type
Parameter
Class
Class type
Source
sun is an OCaml executable to take screenshot from the command line in Wayland, using grim and slurp.
sun can be installed with opam:
opam install sunIf 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.
Taking a screenshot is as simple as:
$ sun
screenshot saved at /home/doratheexplorer/img/20230124_20h01m04s_sun.pngThe output file can be specified like this:
$ sun /tmp/cheese.png
screenshot saved at /tmp/cheese.pngBy 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/sun.scfg with the following content:
output_dir /home/winniethepooh/screenshots