diff options
Diffstat (limited to 'bin/grimshot')
| -rwxr-xr-x | bin/grimshot | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/bin/grimshot b/bin/grimshot new file mode 100755 index 0000000..b946c27 --- /dev/null +++ b/bin/grimshot @@ -0,0 +1,15 @@ +#!/bin/sh +set -eu + +screenshot_dir=$XDG_PICTURES_DIR/screenshots +screenshot_path=$screenshot_dir/"$(date --iso-8601=seconds).png" + +mkdir -p $screenshot_dir || exit 1 + +grim -g "$(slurp)" "$screenshot_path" || exit 1 + +wl-copy --type image/png < "$screenshot_path" || exit 1 + +wl-copy --primary "$screenshot_path" || exit 1 + +fyi -a grimshot -i "$screenshot_path" "grimshot" "$screenshot_path" |