A simple client that:
- implements communication over WebSocket using
generic-client
and FFI - integrates with macOS clipboard to read/write clipboard text
- shows a tray icon with last 5 clips
- shows a system notification every time a new text is received
If you have your server up and running, make sure to create a config in ~/.config/mpclipboard/config.toml
:
uri = "ws://host:port" # or "wss://host:port" if you use SSL
token = "s3cr3t"
name = "macos-client"
# Downloads header and pre-compiled static library (both can be built manually)
just sync
just build Release # or Debug
The app will be in build/Release/mpclipboard.app
(or build/Debug/mpclipboard.app
).
- Debug build of the app always reads local config file from
config.toml
, Release build always reads from$HOME/.config/mpclipboard/config.toml
. - The app is not signed, so you need to manually approve running it locally (or take the binary manually out of the quarantine).
- There's no API in macOS to subscribe to clipboard changes, so we poll it manually every 0.1s. If you know a better way to track clipboard updates please open an issue.
If you have installed the app, it should be located at /Applications/mpclipboard.app
. macOS apps are just directories with a pre-defined, well-known structure. The main executable file is located at /Applications/mpclipboard.app/Contents/MacOS/mpclipboard
.
If the app doesn't start, first try running it from the console:
RUST_LOG=info /Applications/mpclipboard.app/Contents/MacOS/mpclipboard
This should most probably give you some insight about what's missing or incorrect (most probably it's the config). If the error doesn't explain what's wrong, feel free to create an issue.