From 149867f8217b802758393f51c82c48454df1b7b8 Mon Sep 17 00:00:00 2001 From: Siina Mashek Date: Sun, 20 Nov 2022 22:18:12 +0200 Subject: [PATCH] Re-adding boop, now using wayland --- common/boop.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 common/boop.sh diff --git a/common/boop.sh b/common/boop.sh new file mode 100755 index 0000000..cb07b1b --- /dev/null +++ b/common/boop.sh @@ -0,0 +1,21 @@ +#!/bin/sh +# +# Siina's bootleg boop.icu uploader +# +# Requires: +# - wl-clipboard: 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 wl-copy)" ]]; then echo "Please install wl-clipboard"; exit; fi +if [[ ! -n "$(which curl)" ]]; then echo "Please install curl"; exit; fi + +url=$(curl -F"file=@$1" $remote) +echo "$url" | tr -d '\n' | wl-copy + +if [[ -n "$(which ffplay)" ]]; then + ffplay $sound -nodisp -autoexit -loglevel error +fi +