nix/scripts/bin/scrup
2023-09-05 15:15:43 -05:00

20 lines
378 B
Bash
Executable file

#!/usr/bin/env bash
set -x
remote_dir="scrots"
url_prefix="https://files.lyte.dev/$remote_dir"
u="$(uuid -v4)"
d="$(date +%Y-%m-%d_%H-%M-%S)"
fn="$(clipshot)"
if [ $? -eq 0 ]; then
echo "Scrot captured. Uploading..."
upload "${fn}" "scrup-$u-$d.png" "$remote_dir"
echo "$url_prefix/scrup-$u-$d.png" | clip
notify-send "Scrot uploaded. URL in clipboard."
else
exit 1
fi