local-bin/common/boop.sh
2022-03-18 19:50:49 +02:00

21 lines
533 B
Bash
Executable File

#!/bin/sh
#
# Siina's bootleg boop.icu uploader
#
# Requires:
# - xsel: for clipboard manipulation
# - curl: for uploading
remote="https://boop.icu"
sound="$HOME/Projects/local-bin/sounds/success.ogg"
# Make sure necessary applications are installed
if [[ ! -n "$(which xsel)" ]]; then echo "Please install xsel"; exit; fi
if [[ ! -n "$(which curl)" ]]; then echo "Please install curl"; exit; fi
url=$(curl -F"file=@$1" $remote)
echo "$url" | tr -d '\n' | xsel -ib -l /tmp/xsel.log
if [[ -n "$(which mpv)" ]]; then
mpv $sound
fi