This repository has been archived on 2024-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/common/bin/scrup

19 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