Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

smart_paste Profanity plugin

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

Commands

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

Building

Requires GTK3 and GLib development headers.

make

This produces build/smart_paste.so.

Installation

Install the plugin to your local Profanity plugins directory:

make install

This copies the plugin to ~/.local/share/profanity/plugins/.

Usage

Load the plugin in Profanity:

/plugins load smart_paste

Then use /spaste in any chat or room window. The plugin will:

  1. If you copied a file in your file manager → sends that file
  2. If you took a screenshot or copied an image → saves it as a temp file (format per /spaste image-format) and sends it
  3. If you copied text → pastes it as a message (with leading \n for multiline text if newline prefix is on)

Settings examples

/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.

Uninstallation

rm ~/.local/share/profanity/plugins/smart_paste.so

About

Profanity plugin that pastes clipboard content intelligently

Topics

Resources

Stars

Watchers

Forks

Releases

Contributors

Languages