#!/bin/sh set -eu screenshot_dir=$XDG_PICTURES_DIR/screenshots screenshot_path=$screenshot_dir/"$(date --iso-8601=seconds).png" mkdir -p $screenshot_dir || exit 1 grim -g "$(slurp)" "$screenshot_path" || exit 1 wl-copy --type image/png < "$screenshot_path" || exit 1 wl-copy --primary "$screenshot_path" || exit 1 fyi -a grimshot -i "$screenshot_path" "grimshot" "$screenshot_path"