Wox icon indicating copy to clipboard operation
Wox copied to clipboard

Provide access to `Clipboard` via WoxAPI

Open ashu-tosh-kumar opened this issue 2 years ago • 3 comments

This feature request is regarding providing access to C# Clipboard library (copy and paste) through public methods in WoxAPI so that plugins written in other languages can easily interact with the Windows Clipboard.

Reason:

I have written an offline dictionary plugin for Wox in python3: GitHub Wox.

Some user requested for ability to copy the definition on hitting Enter. I researched about doing so here are the methods available:

  1. Use an external library like pyperclip but that doesn't work in Wox. Also it's not ideal as it adds requirements for an external library
  2. Use python os or sbprocess library to directly run something like f"echo '{data}' | clip" command but this is dangerous as it allows for Shell Injection.
  3. Use the ctypes library to directly run some C code. Not preferred as it's too complex and requires lot of consideration for different kind of machines.

I think it is far better approach and would be useful too for other plugins if the natively available Clipboard library in C# is made available via RPC calls in WoxAPI

ashu-tosh-kumar avatar Dec 22 '22 11:12 ashu-tosh-kumar

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Nov 02 '23 12:11 github-actions[bot]

Awaiting comments.

ashu-tosh-kumar avatar Nov 09 '23 05:11 ashu-tosh-kumar

Hi, I prefer to use external library like pyperclip. Many of the plugins we write depend on external modules, and we should package these dependencies into a Wox plugin. We don't want to introduce APIs that have nothing to do with Wox functionality for now, , we want to keep the interface lean. Thx.

qianlifeng avatar Nov 09 '23 13:11 qianlifeng