leanshot/contrib/leanshot-hashed.sh

16 lines
256 B
Bash
Raw Permalink Normal View History

2018-12-14 04:35:06 +00:00
#!/bin/bash
set -eu
2020-12-24 18:49:39 +00:00
outdir=$HOME/Pictures/Screenshots
2018-12-14 04:35:06 +00:00
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}"