Skip to content

nNoidea/rustyclip

Repository files navigation

RustyClip

Lightweight Wayland clipboard manager — a small background daemon plus a compact overlay GUI.

RustyClip captures text and images from the clipboard, keeps a short in-memory history, and provides a simple Wayland GUI to browse, preview and paste items.

Features

  • Minimal, focused design: separate daemon and gui components
  • Captures both text and images
  • Image thumbnails for fast browsing
  • Deduplicates identical clipboard entries
  • In-memory SQLite history (default limit: 50 items)
  • Secure local IPC over a Unix domain socket (GUI/clients verify peer credentials)
  • Single-instance locking for daemon and GUI
  • Attempts to simulate paste on select (uses wtype if available)

Requirements

  • Linux with a Wayland compositor
  • Rust toolchain (stable)
  • Optional: wtype (to enable automatic paste-after-select)
  • XDG_RUNTIME_DIR should be set (used for socket and lock files); falls back to /tmp

Build

Build the whole workspace:

git clone <repo-url>
cd rustyclip
cargo build --release

Build individual crates:

cargo build -p rustyclip-daemon --release
cargo build -p rustyclip-gui --release

Run

Start the daemon (background):

# using cargo (development)
cargo run -p rustyclip-daemon --release &

# or the compiled binary
./target/release/rustyclip-daemon &

Start the GUI (after the daemon is running):

cargo run -p rustyclip-gui --release
# or
./target/release/rustyclip-gui

Controls (GUI)

  • Up / Down — navigate history
  • Enter — select and paste the current item
  • Escape — exit the GUI
  • A CLEAR HISTORY entry is available in the GUI footer

IPC / Protocol

RustyClip exposes a small ASCII command protocol over a Unix domain socket. By default the socket is placed at $XDG_RUNTIME_DIR/rustyclip.sock (or /tmp/rustyclip.sock when XDG_RUNTIME_DIR is not set).

Commands the daemon understands:

  • FETCH — returns a bincode-serialized Vec<ClipboardItem> (used by the GUI)
  • GET_BLOB <id> — returns the raw bytes for the item with the given id
  • SET <id> — copies the item to the clipboard and attempts to paste it (spawns wtype)
  • CLEAR — clears the in-memory history

The daemon also enforces peer credential checking on the socket to limit access to the same user.

Notes & Limitations

  • History is kept in memory (SQLite opened in-memory). Clipboard history is not persisted across daemon restarts.
  • The GUI is Wayland-only (uses smithay-client-toolkit / layer-shell).
  • If automatic paste does not work, ensure wtype is installed or change the paste helper logic.

Contributing

Contributions are welcome. A suggested workflow:

  1. Fork the repository and create a branch for your change.
  2. Run and test locally with cargo run -p <crate>.
  3. Open a pull request with a clear description and rationale.

License

This project is licensed under the GNU Affero General Public License version 3.0 (AGPL-3.0). See the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors