#!/bin/sh

# Takes a screenshot of the screen and sends a notification with a preview

FOLDER=~/pictures/screenshots
FILENAME=$FOLDER/$(date "+%H-%M-%S_%d-%m-%Y_scrot.png")

[ -d $FOLDER ] && scrot -q 100 $FILENAME \
	|| $(mkdir -p $FOLDER \
	&& echo "Folder $FOLDER created" \
	&& scrot -q 100 $FILENAE)

convert -brightness-contrast 10x10 $FILENAME \
	-resize 512x512 /tmp/takescreenshot_icon.png

# ACTION=$(dunstify -r 1 -t 5000 -h "string:bgcolor:#111111" "Saving screenshot to $FOLDER" -h "string:bgcolor:#111111" "Right click to open" --action=3,Open -i /tmp/takescreenshot_icon.png)

# [ $ACTION -eq 3 ] && xdg-open $FILENAME;
