Adding Clipboard Management Support

This guide explains how to contribute support for an environment where clipboard management is currently unsupported. If the method described here doesn’t fully meet your environment’s needs, please open a new issue to discuss it.

Introduction

Clipboard management in Vicinae is straightforward:

  • An environment-agnostic clipboard service encapsulates all selection storing and retrieval logic.
  • At startup, the service spawns a clipboard server (chosen by activation logic) and waits for it to notify new selections.

In short: a clipboard server connects to the relevant system API/DBus interface and simply notifies the service of new selections via the selectionAdded signal.

Server Implementation

A server is an object inheriting from AbstractClipboardServer.

  • The base class is documented and self-explanatory.
  • To add support for your environment:
    1. Create a new subdirectory for your implementation.
    2. Provide both .hpp and .cpp files with your implementation.

You can refer to the wlr clipboard server implementation as a reference.

Register Your Server

Finally, register your server in the clipboard service constructor so that it can be considered as an activatable option.

Was this page helpful?