local-bin/common/boop.sh

21 lines
535 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
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 mpv)" ]]; then
mpv $sound
fi