dotfiles/dot_local/scripts/executable_screenshot.sh
2021-08-14 23:06:10 -05:00

20 lines
508 B
Bash

#!/bin/bash
set -e
SCREENSHOT=leanshot
# choose some file to save it to
FILENAME="$(date +%Y-%m-%d-%H:%M:%S).png"
FILE="$HOME/Screenshots/$FILENAME"
$SCREENSHOT $1 -o $FILE
# copy to clipboard
XCLIP=/usr/bin/xclip
$XCLIP -selection clipboard -t image/png -i $FILE
notify-send "captured $FILENAME"
# upload it
# url=$(ssh -vv -i $HOME/.ssh/id_rsa homelab $HOME/.local/bin/file-upload $FILENAME < $FILE 2> log)
# url=${url%$'\n'}
# $XCLIP -selection clipboard <<< "$url"
# notify-send "uploaded $FILENAME"