Refactor bin/scrcap

This commit is contained in:
Henrik Lissner 2020-01-03 22:56:12 -05:00
parent a17194cc2f
commit 21d1570706
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -4,6 +4,8 @@
# capture) and stores it in the clipboard. # capture) and stores it in the clipboard.
tmp=$(mktemp) tmp=$(mktemp)
cleanup() { rm -f "$tmp"; }
trap cleanup EXIT
# Delay for long enough that we can refocus the targeted window # Delay for long enough that we can refocus the targeted window
if maim --delay=${1:-0.6} -us >"$tmp"; then if maim --delay=${1:-0.6} -us >"$tmp"; then
@ -12,5 +14,3 @@ if maim --delay=${1:-0.6} -us >"$tmp"; then
else else
notify-send -u low "Aborted screenshot" notify-send -u low "Aborted screenshot"
fi fi
rm -f "$tmp"