dotfiles/Scripts/screenshot-select.sh

24 lines
490 B
Bash
Raw Normal View History

#!/bin/bash
# take screenshot of selection and save to
# default screenshots directory
# set default screenshots directory
dir="/home/emge/Pictures/screenshots/"
# set current date
curDate=$(date +"%Y-%m-%d")
i="1"
file=$dir$curDate"_"$i".png"
while [ -f $file ] ;
do
i=$((i + "1"))
file=$dir$curDate"_"$i".png"
done
grim -g "$(slurp)" $file
# show screenshot notification
dunstify -u low -i accessories-screenshot -h string:x-dunst-stack-tag:Screenshot "Screenshot saved:" $file