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
|
2023-02-18 22:42:58 +01:00
|
|
|
myfile="$(openssl rand -base64 9 | tr / -)_$(date +%y%m%d%H%M%S).webp"
|
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
|
|
|
# copy-paste
|
2021-05-23 17:22:46 +02:00
|
|
|
wl-copy <<< "$fileurl"
|
2024-06-08 11:02:42 +02:00
|
|
|
grimshot save anything "$HOME/screenshot-tmp.ppm"
|
2022-06-04 14:33:18 +02:00
|
|
|
cwebp -preset picture -q 100 "$HOME/screenshot-tmp.ppm" -o "$HOME/public/s/$myfile"
|
|
|
|
rm "$HOME/screenshot-tmp.ppm"
|
|
|
|
|
2016-01-31 18:17:44 +01:00
|
|
|
cd ~
|
|
|
|
rsync -LavP --cvs-exclude public pub.yori.cc:
|
2022-06-04 14:33:18 +02:00
|
|
|
notify-send -t 3000 "saved $fileurl"
|