dotfiles/bin/screenshot_public.sh

16 lines
324 B
Bash
Raw Normal View History

2021-05-23 17:22:46 +02:00
#!/usr/bin/env bash
set -e
2016-01-31 18:17:44 +01:00
# Setup filename for the screenshot
2021-05-23 17:22:46 +02:00
myfile="$(openssl rand -base64 9)_$(date +%y%m%d%H%M%S).png"
2016-01-31 18:17:44 +01:00
2021-05-23 17:22:46 +02:00
webpath="https://pub.yori.cc/s/"
fileurl="$webpath$myfile"
2016-01-31 18:17:44 +01:00
2021-05-23 17:22:46 +02:00
grim -g "$(slurp)" "$HOME/public/s/$myfile"
2016-01-31 18:17:44 +01:00
# copy-paste
2021-05-23 17:22:46 +02:00
wl-copy <<< "$fileurl"
2016-01-31 18:17:44 +01:00
cd ~
rsync -LavP --cvs-exclude public pub.yori.cc: