hluk / CopyQ

Clipboard manager with advanced features
GNU General Public License v3.0
8.26k stars 430 forks source link

Feature request: Add QR-code generator #2558

Closed oneofthehorses closed 7 months ago

oneofthehorses commented 7 months ago

Hello!

It would be awesome to see function for fast generation of QR-codes from clipboard :) also QR reader to clipboard too*!

And (look into further) possibility to exchange public keys first, to establish secure communication channel (if works in public space, not home) so no man in the middle can catch real clipboard information

Thanks for your work!!

hluk commented 7 months ago

This is supported through commands. The following command (uses qrcode utility - must be installed) creates a new item with the QR code from currently selected text item (see README.md for details on how to add the command):

[Command]
Command="
    copyq:
    const result = execute('qrcode', '--factory=pil', null, input());
    if (!result) {
        popup('Failed to run qrcode');
        abort();
    }
    if (result.exit_code != 0) {
        popup('Failed to run qrcode', result.stderr);
        abort();
    }
    write('image/png', result.stdout);"
Icon=\xf029
InMenu=true
Input=text/plain
Name=QR Code
oneofthehorses commented 7 months ago

qrcode utility installed but command failed to run, despite installed correctly

hluk commented 7 months ago

qrcode utility installed but command failed to run, despite installed correctly

CopyQ must be able to find the utility, i.e. it must be reachable from a directory listed in PATH environment variable.