From 36f1f8a3e5013e7a91368fa2f0bec4fcc255c9b9 Mon Sep 17 00:00:00 2001 From: Tobias Date: Wed, 5 Aug 2026 21:41:20 +0000 Subject: [PATCH] Update catboxuploader --- catboxuploader | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/catboxuploader b/catboxuploader index 51a1d45..fcf1a76 100644 --- a/catboxuploader +++ b/catboxuploader @@ -18,13 +18,31 @@ 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 +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" || main + + +[ -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 +} + + +main && echo "uploaded" \ No newline at end of file