Skip to content

Instantly share code, notes, and snippets.

@CircuitRCAY
Last active June 26, 2021 13:16
Show Gist options
  • Save CircuitRCAY/e0d070596c03ca522e7a23a865003103 to your computer and use it in GitHub Desktop.
Save CircuitRCAY/e0d070596c03ca522e7a23a865003103 to your computer and use it in GitHub Desktop.
whats-th.is uploader using owo.sh and maim
#!/bin/sh
#
# A custom uploader script using maim and owo.sh
#
# Made by CircuitRCAY (@CircuitRCAY)
#
DOMAIN="https://tik-tok.is-bad.com"
FILE="/tmp/upload.png"
function usage()
{
echo "OwO uploader, made in bash."
echo ""
echo "./uploader.sh"
echo " -h --help"
echo " --domain=$DOMAIN"
echo " --region"
echo ""
}
function region_capture()
{
maim -s $FILE; owo --clipboard --domain $DOMAIN -u $FILE || { notify-send "Error uploading"; exit -1; }
notify-send -i $FILE -a "OwO.sh uploader" "Uploaded $(xclip -o)"
rm $FILE
}
function screen_capture()
{
maim $FILE; owo --clipboard --domain $DOMAIN -u $FILE || { notify-send "Error uploading"; exit -1; }
notify-send -i $FILE -a "OwO.sh uploader" "Uploaded $(xclip -o)"
rm $FILE
}
while [ "$1" != "" ]; do
PARAM=`echo $1 | awk -F= '{print $1}'`
VALUE=`echo $1 | awk -F= '{print $2}'`
case $PARAM in
-h | --help)
usage
exit
;;
--region)
region_capture
exit
;;
--domain)
DOMAIN=$VALUE
;;
--screen)
screen_capture
exit
;;
*)
echo "ERROR: unknown parameter \"$PARAM\""
usage
exit 1
;;
esac
shift
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment