#!/bin/sh printf "Usage: soundpost \\n" image=$1 sound=$2 HOST="https://catbox.moe/user/api.php" link=$(curl -F "reqtype=fileupload" -F "fileToUpload=@$sound" $HOST) printf "%s" "Uploaded sound to: $link" printf "\\n" encode=$(echo "$link" | tail -c +9 | sed 's/:/%3A/g' | tr "/" "-" | sed "s/-/%2F/g") imagefilename=${image##*'/'} beforedot=${imagefilename%%'.'*} afterdot=${imagefilename##*'.'} final="${beforedot}[sound=$encode].$afterdot" # Add filename to clipboard printf "%s" "$final" | xclip -selection clipboard # Copy image with the appropriate filename printf "Copying image...\\n" cp "$image" "$final"