summary refs log tree commit diff
path: root/bin/grimshot
blob: b946c27041dd229a5d0e663985b995f29dc68c71 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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"