Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-flamous committed Apr 29, 2023
1 parent e1606de commit ef5d440
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions screenshot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ if [[ "$1" == "-s" ]]; then
IMAGENAME="$(date +'%d_%m_%Y-%H_%M_%S_%3N')"
FILE="$IMAGEPATH$IMAGENAME.png"
xclip -t image/png -sel clip -o > "$FILE"
URL=$(curl -F "file=@$FILE" https://x0.at/ 2>/dev/null)
URL=$(xclip -t image/png -sel clip -o | curl -F "file=@-;filename=.png" -Fsecret= https://0x0.st/ 2>/dev/null)
printf "%s" "$URL" | xclip -sel clip
echo "$URL"
notify-send "Screenshot copied" "$URL"
# -c: copy data from clipboard and upload to x0.at
# -c: copy
elif [[ "$1" == "-c" ]]; then
URL=$(xclip -t image/png -sel clip -o | curl -F "file=@-" https://x0.at/ 2>/dev/null)
URL=$(xclip -t image/png -sel clip -o | curl -F "file=@-;" -Fsecret= https://0x0.st/ 2>/dev/null)
printf "%s" "$URL" | xclip -sel clip
echo "$URL"
notify-send "Data copied" "$URL"
Expand Down

0 comments on commit ef5d440

Please sign in to comment.