Add file target feature for screenshot

This commit is contained in:
Tobias Reisinger 2021-04-23 19:38:05 +02:00
parent 98cd592233
commit 61fb97773c
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
2 changed files with 30 additions and 8 deletions

15
.config/restic/ignore Normal file
View file

@ -0,0 +1,15 @@
venv/
*.pyc
.DS_Store
*.swp
*.swo
.syntastic_*_config
.breakpoints
latexmk_output/
node_modules/

View file

@ -4,18 +4,25 @@ s3_bucket=public.serguzim.me/screenshots
s3_host=https://sos-de-fra-1.exo.io s3_host=https://sos-de-fra-1.exo.io
path=/tmp/screenshot.png path=/tmp/screenshot.png
if flameshot gui -r > $path process_image()
then {
file=$(date "+%F_%H-%M-%S").png file=$(date "+%F_%H-%M-%S").png
xclip -t image/png $path -selection clipboard xclip -t image/png $1 -selection clipboard
s3cmd put -P $path s3://$s3_bucket/$file s3cmd put -P $1 s3://$s3_bucket/$file
echo -n "$s3_host/$s3_bucket/$file" | xclip -selection primary echo -n "$s3_host/$s3_bucket/$file" | xclip -selection primary
notify-send -a "Screenshot" "Uploaded screenshot to s3" notify-send -a "Screenshot" "Uploaded screenshot to s3"
}
if [ -n "$1" ] && [ -e "$1" ]
then
convert $1 $path
process_image $path
else
if flameshot gui -r > $path
then
process_image $path
fi
fi fi