dotfiles-remastered/.local/share/scripts/take-screenshot.sh

17 lines
301 B
Bash
Raw Normal View History

2020-06-30 22:21:39 +00:00
#!/usr/bin/env sh
2024-03-31 21:16:00 +00:00
# Make a selection of the screen and take a screenshot. Save it to tmp and print its path.
2020-06-30 22:21:39 +00:00
set -e
TMPDIR=$(mktemp -d)
2023-12-02 01:24:01 +00:00
GRIM_DEFAULT_DIR="$TMPDIR" grim -g "$(slurp)"
2020-06-30 22:21:39 +00:00
filename="$(date +"%d-%m-%y-%H-%M-%Z").png"
mv $TMPDIR/* "$TMPDIR/$filename"
2020-07-14 16:58:37 +00:00
printf "%s\n" "$TMPDIR/$filename"
2020-06-30 22:21:39 +00:00