From 22b6e7556f86701dc8afb60b0c605e1d2667ea12 Mon Sep 17 00:00:00 2001 From: Nathan Ringo Date: Thu, 13 Dec 2018 22:35:06 -0600 Subject: [PATCH] Adds contrib/leanshot-hashed.sh. --- contrib/leanshot-hashed.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 contrib/leanshot-hashed.sh diff --git a/contrib/leanshot-hashed.sh b/contrib/leanshot-hashed.sh new file mode 100755 index 0000000..1413a52 --- /dev/null +++ b/contrib/leanshot-hashed.sh @@ -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}"