leanshot/contrib/leanshot-hashed.sh
2020-12-24 12:49:39 -06:00

15 lines
256 B
Bash
Executable file

#!/bin/bash
set -eu
outdir=$HOME/Pictures/Screenshots
mkdir -p "${outdir}"
file=$(mktemp --suffix .png)
trap "rm \"${file}\"" EXIT
leanshot -o "${file}" $@
out="${outdir}/$(sha1sum "${file}" | cut -d ' ' -f 1).png"
cp "${file}" "${out}"
echo "${out}"