Create custom upload targets for the KDE Plasma 6 Share menu. New targets are user-definable in JSON; no code modification required. Catbox and Uguu included by default.
GPL-3.0-or-later.
cmake -S . -B build
cmake --build buildcmake --install buildPlugins install to the Purpose plugin directory (${KDE_INSTALL_QTPLUGINDIR}/kf6/purpose).
Restart Dolphin/Gwenview/other Purpose-Share-enabled app after installing so the new Share action shows up.
Targets live in targets.json. Each entry generates its own Share plugin at configure time.
After editing targets.json, re-run the configure step (cmake -S . -B build) so plugins are regenerated.
Additional example targets are available in targets.sample.json for reference when adding new services.
Each target entry is an object inside the targets array. Required fields:
id: lowercase identifier used for plugin names;[a-z0-9][a-z0-9_-]*.displayName: human-friendly name shown in Share menus.description: short description for plugin metadata.icon: icon name (e.g.image-x-generic).request: upload configuration (see below).response: how to extract the URL from the server response.
Optional fields:
pluginTypes: Purpose plugin types (defaults to["ShareUrl"]).constraints: Purpose constraints (e.g.["mimeType:image/*"]).
request includes:
url: upload endpoint URL. Supports${ENV:VAR}substitution.method: HTTP method.POSTfor multipart;POSTorPUTfor raw uploads.type(optional):multipart(default) orraw.
Multipart uploads:
request.type:multipart(or omitted).request.multipart.fileField: form field name for the file.request.multipart.fields: optional extra form fields (string values only).
Raw uploads:
request.type:raw.request.urlmay include${FILENAME}to inject the local file name (e.g. transfer.sh).request.contentType: optional Content-Type to set for the file body.
Headers:
request.headers: object of header name -> value (string values only), values support${ENV:VARNAME}substitution.
response must include a type:
text_url: response body is the URL.regex: usepatternand optionalgroupto extract URL from response text.json_pointer: usepointer(must start with/) to locate a string URL in a JSON response.
{
"id": "example",
"displayName": "ExampleHost",
"description": "Upload images to ExampleHost",
"icon": "image-x-generic",
"pluginTypes": ["ShareUrl", "Export"],
"constraints": ["mimeType:image/*"],
"request": {
"url": "https://example.com/upload",
"method": "POST",
"multipart": {
"fields": {
"token": "${ENV:EXAMPLE_TOKEN}"
},
"fileField": "file"
}
},
"response": {
"type": "json_pointer",
"pointer": "/data/url"
}
}