Many changes

This commit is contained in:
Jonathan Hodgson 2019-10-10 17:29:09 +01:00
parent 0526302f3e
commit 90fc6ab4fb
39 changed files with 1416 additions and 18 deletions

View file

@ -4,15 +4,25 @@
#
# When run, the screenshot will be added to she clipboard
path='/tmp'
#If a project is set we will put screenshots in the project's folder
project=$(project current --path)
if [ -n "$project" ]; then
path="$project/screenshots"
#Make the directory if it doesn't exist
mkdir "$path" 2> /dev/null
fi
case $1 in
"window")
file=$(scrot -u '/tmp/%F_%T_$wx$h.png' -e 'echo -n /tmp/%F_%T_$wx$h.png')
file=$(scrot -u "$path/%F_%T_\$wx\$h.png" -e "echo -n $path/%F_%T_\$wx\$h.png")
;;
"select")
file=$(sleep 0.2; scrot -s '/tmp/%F_%T_$wx$h.png' -e 'echo -n /tmp/%F_%T_$wx$h.png')
file=$(sleep 0.2; scrot -s "$path/%F_%T_\$wx\$h.png" -e "echo -n $path/%F_%T_\$wx\$h.png")
;;
*)
file=$(scrot '/tmp/%F_%T_$wx$h.png' -e 'echo -n /tmp/%F_%T_$wx$h.png')
file=$(scrot "$path/%F_%T_\$wx\$h.png" -e "echo -n $path/%F_%T_\$wx\$h.png")
;;
esac