wclip is a command line tool to copy data to the windows clipboard. It can take data from a file or stdin, e.g. using the pipe.
wclip adds the --secret
option to tell ClipMate, AceText and other clipboard viewers not to capture the copied data. This way the clipboard history can be kept free from passwords copied from a password manager like password-store.
wclip is used in pass-extension-wclip, an extension for password-store.
wclip - command line interface to the windows clipboard
usage: wclip [option] [file]
Reads from standard in when no file is given or a file and makes the data available in the clipboard.
-v, --version show version information
-h, --help show usage information
-o, --out prints the copied data to stdout
-s, --secret hides the copied data from clipboard history tools
(generally used for passwords)
pass some/secret/password | wclip --secret
Copies the password to the clipboard without having it stored in the clipboard history.
wclip is build with CMake and Visual Studio, preferably using the command line.
Open a VS2015 x64 Native Tools Command Prompt
and change to your working directory
Add cmake to the PATH if necessary.
Clone the wclip repository
git clone https://github.com/palortoff/wclip.git
Enter the project folder
cd wclip
Create and enter the build folder
mkdir build
cd build
Create NMake make files for the Release configuration:
cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release ..
or the Debug configuration:
cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Debug ..
Or create a Visual Studio solution file:
cmake -G "Visual Studio 12 2013 Win64" ..
To compile wclip now run:
nmake
To build with Visual Studio open the wclip.sln
solution file and build in Release or Debug configuration.
The binary will be written to
<repository root>/dist/release
or
<repository root>/dist/debug
The wclip tests are written with Bats and use the wclip.exe in Release configuration from dist/release
.
Bats requires a bash to run Open a bash shell (like the git bash for windows) in the wclip repository root. If you don't have bats already configured, run bats like this:
<path to bats repository root>/libexec/bats tests
This tests the complete wclip functionality except for the --secret
parameter, as this is not possible with simple shell capabilities.
As windows does not have a designated location to put binaries that are available in the path, simply copy the wclip.exe
from dist/release
to a location available in the path. Wclip is linked statically so there is no need to install a runtime or other libraries.
wclip is based on this xlip port to windows: https://gist.github.com/Rapptz/9664773178da1bc397cf
Ignoring Clipboard Updates with the CF_CLIPBOARD_VIEWER_IGNORE Clipboard Format