Building from source requires an internet connection. Open command prompt and run the commands:
Download and install NodeJS for Windows.
Node/NPM packages are outdated when installating via apt
. Install latest version via NVM instead:
# Install NodeJS via NVM installer
$ curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
$ source ~/.profile
$ nvm install node
# Check installation
$ node --version
$ npm -v
# Clone repository
$ git clone https://github.com/Erriez/Clipboarder.git
$ cd Clipboarder
# Install NPM packages
$ npm install
# Set permission / owner chrome-sandbox
$ sudo chown root:root node_modules/electron/dist/chrome-sandbox
$ sudo chmod 4755 node_modules/electron/dist/chrome-sandbox
# Run
$ npm run start
# Optional: Test electron-builder
$ node_modules/electron-builder/cli.js --help
# Create release on Windows for Windows (NSIS installer)
$ npm run release-windows
# Create release on Linux x64 for Linux (AppImage)
$ npm run release-linux
# Create release on Linux x64 or armv7l for armv7l Linux (AppImage)
$ npm run release-armv7l
# Create release on Linux x64 or arm64 for arm64 Linux (AppImage)
$ npm run release-arm64
This project has a dependency on clipboard-event package to
generate an event when clipboard change is detected. It runs an optimized C application clipboard-event-handler
in the background.
The executable flag should be set after installing the clipboard-event package via NPM, otherwise no clipboard changes are detected:
# Set execute flag
$ chmod +x Clipboarder/node_modules/clipboard-event/platform/clipboard-event-handler-linux
The executable must be rebuild from source to support Raspberry Pi (Rasbian).
Build from source for Ubuntu or Rasbian:
# When this build error occurs:
clipboard-event-handler-linux.c:4:10: fatal error: X11/extensions/Xfixes.h: No such file or directory
4 | #include <X11/extensions/Xfixes.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
# Install system dependency:
$ sudo apt install libxtst-dev
# Build executable
$ cd Clipboarder/node_modules/clipboard-event/platform
$ gcc clipboard-event-handler-linux.c -o clipboard-event-handler-linux -lX11 -lXfixes
Open the clipboarder directory with the free Visual Studio Code.
To start debugging, run the start
script.
The application is build around the popular NodeJS Electron Boilerplate. Reason is easy development, maintenance and deployment.
NPM dependencies:
Clipboard documentation