forked from michael/leanshot
Adds contrib/leanshot-hashed.sh.
This commit is contained in:
parent
f4da063303
commit
22b6e7556f
1 changed files with 15 additions and 0 deletions
15
contrib/leanshot-hashed.sh
Executable file
15
contrib/leanshot-hashed.sh
Executable 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}"
|
Loading…
Reference in a new issue