A Profanity C plugin that pastes clipboard content intelligently:
- Text - sends as a chat message (with optional leading newline for multiline)
- Images (screenshots, copied images) - saves to temp file and sends via
/sendfile - Files (copied from file manager) - sends the file via
/sendfile
| Command | Description |
|---|---|
/spaste |
Paste clipboard content — text as message, images/files as file upload |
/spaste newline on|off |
Toggle leading newline for multiline text (default: on) |
/spaste image-format png|jpeg |
Set image save format for clipboard images (default: png) |
/spaste jpeg-quality <1-100> |
Set JPEG save quality in percent (default: 85) |
/spaste mime-types-path [path] |
Show or set path to mime.types file (default: /etc/mime.types) |
Tab-completion:
/spaste <Tab> → newline, format, jpeg-quality, mime-types-path
/spaste newline <Tab> → on, off
/spaste image-format <Tab> → png, jpeg
Requires GTK3 and GLib development headers.
makeThis produces build/smart_paste.so.
Install the plugin to your local Profanity plugins directory:
make installThis copies the plugin to ~/.local/share/profanity/plugins/.
Load the plugin in Profanity:
/plugins load smart_paste
Then use /spaste in any chat or room window. The plugin will:
- If you copied a file in your file manager → sends that file
- If you took a screenshot or copied an image → saves it as a temp file (format per
/spaste image-format) and sends it - If you copied text → pastes it as a message (with leading
\nfor multiline text if newline prefix is on)
/spaste newline → show current newline prefix setting
/spaste newline on → enable leading newline for multiline text (default)
/spaste newline off → disable leading newline for multiline text
/spaste image-format → show current image format
/spaste image-format jpeg → save clipboard images as JPEG
/spaste image-format png → save clipboard images as PNG (default)
/spaste jpeg-quality → show current JPEG quality
/spaste jpeg-quality 90 → set JPEG quality to 90%
/spaste mime-types-path → show current mime.types path and number of loaded types
/spaste mime-types-path /usr/share/mime.types → use a different mime.types file
Settings are persisted automatically and survive restarts.
rm ~/.local/share/profanity/plugins/smart_paste.so