From ebe7fa7626c8670da765d27c163dfec523ba9019 Mon Sep 17 00:00:00 2001 From: Tobias Date: Wed, 5 Aug 2026 21:49:46 +0000 Subject: [PATCH] Add catboxuploader_kde --- catboxuploader_kde | 54 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 catboxuploader_kde diff --git a/catboxuploader_kde b/catboxuploader_kde new file mode 100644 index 0000000..de89320 --- /dev/null +++ b/catboxuploader_kde @@ -0,0 +1,54 @@ +#!/bin/bash + +filename="$1" + +uploadtime() { + +echo -e "\nbe in the directory of the file you want to upload\ninput how long you want the file to be uploaded for" +read -p "valid options (hours) 1, 12, 24, 72: " time + +case "$time" in + 1|12|24|72 ) + time+="h" + ;; + * ) echo "invalid upload time" + uploadtime + ;; +esac + +} + +clip() { + qdbus org.kde.klipper /klipper setClipboardContents "$(cat < /dev/stdin)" +} + +main(){ + +uploadtime + +echo "uploading..." +curl -F "reqtype=fileupload" -F "time=$time" -F "fileToUpload=@$filename" https://litterbox.catbox.moe/resources/internals/api.php | clip + +} + + + +[ -z "$1" ] && { +echo -e "no file provided\nusage is catboxuploader yourfilehere\nsuch as: catboxuploader 123.txt" +exit 1 +} + + +[ "$#" -gt 1 ] && { +echo -e "error too many arguments\nonly 1 file may be uploaded at at time" +exit 1 +} + + +[ ! -f "$1" ] && { +echo "file not found" +exit 1 +} + + +main && echo "uploaded" \ No newline at end of file