Adds contrib/leanshot-hashed.sh.

This commit is contained in:
Nathan Ringo 2018-12-13 22:35:06 -06:00
parent f4da063303
commit 22b6e7556f
No known key found for this signature in database
GPG key ID: 327460FBCD16950B

15
contrib/leanshot-hashed.sh Executable file
View file

@ -0,0 +1,15 @@
#!/bin/bash
set -eu
outdir=~/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}"