dotfiles-remastered/.local/share/scripts/take-screenshot.sh
2024-03-31 23:16:00 +02:00

17 lines
301 B
Bash
Executable File

#!/usr/bin/env sh
# Make a selection of the screen and take a screenshot. Save it to tmp and print its path.
set -e
TMPDIR=$(mktemp -d)
GRIM_DEFAULT_DIR="$TMPDIR" grim -g "$(slurp)"
filename="$(date +"%d-%m-%y-%H-%M-%Z").png"
mv $TMPDIR/* "$TMPDIR/$filename"
printf "%s\n" "$TMPDIR/$filename"