diff options
author | Hugo Osvaldo Barrera <hugo@barrera.io> | 2020-05-01 18:03:07 +0200 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2020-05-05 20:18:19 +0200 |
commit | 9cda5a5bd62efe161217481147121d5de8a8dc20 (patch) | |
tree | f0f72b66712b386e85cb7ace94c42e0d15029d6a /contrib/grimshot | |
parent | f82de63856af94c2649901cbb303a42531d27cac (diff) |
grimshot: Skip creating a temp file when copying
Diffstat (limited to 'contrib/grimshot')
-rwxr-xr-x | contrib/grimshot | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/contrib/grimshot b/contrib/grimshot index 08a5fd1b..2e30c69e 100755 --- a/contrib/grimshot +++ b/contrib/grimshot @@ -8,7 +8,6 @@ ## - `wl-copy`: clipboard utility ## - `jq`: json utility to parse swaymsg output ## - `notify-send`: to show notifications -## - `mktemp`: to create a temporary file ## Those are needed to be installed, if unsure, run `grimshot check` ## ## See `man 1 grimshot` or `grimshot usage` for further details. @@ -109,7 +108,6 @@ if [ "$ACTION" = "check" ] ; then check wl-copy check jq check notify-send - check mktemp exit elif [ "$SUBJECT" = "area" ] ; then GEOM=$(slurp -d) @@ -134,10 +132,7 @@ else fi if [ "$ACTION" = "copy" ] ; then - TMP=$(mktemp) || die "Unable to create temp file: is mktemp installed?" - takeScreenshot "$TMP" "$GEOM" "$OUTPUT" - wl-copy --type image/png < "$TMP" || die "Clipboard error" - rm "$TMP" + takeScreenshot - "$GEOM" "$OUTPUT" | wl-copy --type image/png || die "Clipboard error" notifyOk "$WHAT copied to buffer" else if takeScreenshot "$FILE" "$GEOM" "$OUTPUT"; then |