local-bin/common/boop.sh

21 lines
573 B
Bash
Raw Normal View History

#!/bin/sh
#
# Siina's bootleg boop.icu uploader
#
# Requires:
# - xsel: for clipboard manipulation
# - curl: for uploading
remote="https://boop.icu"
2020-12-20 20:30:34 +02:00
sound="$HOME/Projects/local-bin/sounds/success.ogg"
# Make sure necessary applications are installed
2022-03-18 19:50:49 +02:00
if [[ ! -n "$(which xsel)" ]]; then echo "Please install xsel"; exit; fi
if [[ ! -n "$(which curl)" ]]; then echo "Please install curl"; exit; fi
2021-04-08 11:17:33 +03:00
url=$(curl -F"file=@$1" $remote)
2022-03-13 06:19:23 +02:00
echo "$url" | tr -d '\n' | xsel -ib -l /tmp/xsel.log
if [[ -n "$(which ffplay)" ]]; then
ffplay $sound -nodisp -autoexit -loglevel error
fi