Skip to content

bossearch/copas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Copas

A clipboard sharing utility via local network.

Table of Contents

About

Copas is a lightweight utility for sharing clipboard text data between Linux (Wayland) and Android over a local network. It focuses on doing a few things well, offering a minimal alternative for workflows where simplicity and control matter.

The Purpose of this project is to evolve into a minimal peripheral bridge, allowing an Android device to serve as a seamless clipboard peer, touchpad, and keyboard.

Getting Started

What you need and how to set up Copas on your system.

Prerequisites

Copas is written in C++ and built using CMake. If you are using Nix, all dependencies are provided automatically. For manual installation, the following runtime libraries are required:

  • GTK 3
  • Libayatana AppIndicator
  • wl-clipboard
Installing Dependencies

Ubuntu and derivatives

sudo apt install -y libgtk-3-0t64 libayatana-appindicator3-1 wl-clipboard

Arch and derivatives

sudo pacman -S --needed gtk3 libayatana-appindicator wl-clipboard

Fedora and derivatives

sudo dnf install -y gtk3 libayatana-appindicator-gtk3 wl-clipboard

Installation

To install the Copas, choose and follow the steps below:

Nix

Try it out

nix run github:bossearch/copas

# With params
nix run github:bossearch/copas -- --help

Flake

  1. Clone and cd to the git repository.
git clone https://github.com/bossearch/copas.git
cd copas
  1. Enter nix dev shell
nix develop
nix build
  1. Find the binary inside ./result/bin/copas

Home-manager module

Add input to your flake.nix:

inputs = {
    copas.url = "github:bossearch/copas";
}

Enable copas:

{
  inputs,
  ...
}: {
  # Add the Home Manager module
  imports = [inputs.copas.homeManagerModules.default];

  programs.copas = {
    enable = true;
    # systemd = false;
    # settings = {
    #   port = 6669;
    #   auth_token = "copas-auto-generated-secret";
    # };
    };
  };
}
Manual Installation
  1. First make sure to install the necessary dependencies.

  2. Download and extract the prebuilt Linux binary from the Release section.

chmod +x copas
./copas --help
  1. You may place the binary to your $PATH.
sudo cp path/to/copas /usr/local/bin/
Build from source
  1. Clone and cd to the git repository.
git clone https://github.com/bossearch/copas.git
cd copas
  1. Configure and build using CMake.
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build
  1. Install the binary.
sudo cmake --install build

The copas binary will be installed to /usr/local/bin by default.

Android The Android client is distributed as a standalone APK.

You can install it using Obtainium or download it manually from the Release section.

Note: The Android APK is currently signed with a debug key.

Usage

By default, Copas works as a Linux clipboard server and an Android client.

How it works

  1. When Copas runs for the first time on Linux, it automatically creates a default configuration file at $XDG_CONFIG_HOME/copas/config.json

  2. This configuration contains:

    • A default TCP port
    • An auto-generated authentication token
  3. Copas exposes a local HTTP API on the configured port.

  4. The Android app connects to the Copas server running on Linux using:

    • Linux local IP address
    • TCP port
    • Authentication token
  5. Once connected, you can pull or push clipboard from the android app.

Configuration

Example config.json:

{
  "port": 6669,
  "auth_token": "copas-auto-generated-secret"
}

Make sure you have TCP port 6669 (or the one selected) opened up in your firewall.

Roadmap

Planned features and future improvements.

  • Clipboard sync between Linux and Android
  • Cursor control (Android as touchpad)
  • Keyboard input from Android
  • End to end encryption (TLS/HTTPS)

License

Distributed under the GPL-3.0-or-later. See LICENSE for more information.

Acknowledgments

(back to top)