{"id":29673693,"url":"https://github.com/agent-hellboy/hcp","last_synced_at":"2025-07-22T22:07:11.690Z","repository":{"id":302654092,"uuid":"1013115971","full_name":"Agent-Hellboy/hcp","owner":"Agent-Hellboy","description":null,"archived":false,"fork":false,"pushed_at":"2025-07-03T14:49:24.000Z","size":1,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-03T14:52:31.661Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Agent-Hellboy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-03T11:36:09.000Z","updated_at":"2025-07-03T14:49:27.000Z","dependencies_parsed_at":"2025-07-03T18:32:33.490Z","dependency_job_id":null,"html_url":"https://github.com/Agent-Hellboy/hcp","commit_stats":null,"previous_names":["agent-hellboy/hcp"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Agent-Hellboy/hcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Agent-Hellboy%2Fhcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Agent-Hellboy%2Fhcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Agent-Hellboy%2Fhcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Agent-Hellboy%2Fhcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Agent-Hellboy","download_url":"https://codeload.github.com/Agent-Hellboy/hcp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Agent-Hellboy%2Fhcp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266580685,"owners_count":23951267,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-22T22:07:10.310Z","updated_at":"2025-07-22T22:07:11.678Z","avatar_url":"https://github.com/Agent-Hellboy.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://github.com/Agent-Hellboy/hcp/actions/workflows/test.yml/badge.svg)](https://github.com/Agent-Hellboy/hcp/actions/workflows/test.yml)\n[![Latest Release](https://img.shields.io/github/v/release/Agent-Hellboy/hcp?label=release)](https://github.com/Agent-Hellboy/hcp/releases)\n\n# hcp\n\n- A lightweight clipboard manager for Linux that stores your clipboard history, allowing you to access and reuse past entries much like how git stash works for code changes.\n- Capture and browse clipboard entries: every time you copy (Ctrl+C) something, it's saved. So if you've copied text 8 times, you can view and retrieve all 8 previous entries, just like accessing stashes in Git.\n\n**Note:** This project currently targets POSIX systems only and uses APIs such as `mkdir`, `getenv`, `popen`, and `stat`. If there is significant user interest, I plan to migrate to cross-platform C++17 APIs in the future.\n\n\n**Note:** This project currently only supports X11 display server. Wayland support has not been implemented yet.\n```bash\necho $XDG_SESSION_TYPE\nx11\n```\n\n## Installation\n\nDownload the latest `.deb` package from [the Releases page](https://github.com/Agent-Hellboy/hcp/releases) and install it with:\n```sh\nsudo dpkg -i hcp_1.0.0.deb\n```\n\n## Development\n\nTo build the .deb package from source, run:\n\n```sh\nsudo  ./build_deb.sh\n```\n\n### After Installation: Check Your Environment\nAfter installing, you should run the following command to check if your environment is set up correctly for clipboard polling:\n\n```sh\nhcp --diagnostic\n```\n\nThis will print all relevant environment variables, the detected display server, and warnings if your setup is not compatible with X11 clipboard polling.\n\n### Other Development Instructions\n- Make sure you have the required build dependencies:\n  ```sh\n  sudo apt-get update\n  sudo apt-get install -y build-essential libx11-dev dpkg-dev\n  ```\n- To clean up previous builds, the script automatically removes any old build directories.\n- After building, you can install the package with:\n  ```sh\n  sudo dpkg -i hcp_*.deb\n  sudo apt-get install -f -y  # To fix any missing dependencies\n  ```\n- To test the clipboard manager, you can run:\n  ```sh\n  ./hcp service start \u0026\n  ./hcp list\n  ./hcp pop\n  ```\n- For systemd integration, follow the post-install instructions printed by the script.\n\n---\n\n## Usage\n\n### Start the Clipboard Service\nThis will monitor your clipboard and save changes:\n```sh\nhcp service start \u0026\n```\n\nor as a systemd service (Recommended):\n\n(You will see instructions after the installation is finished.)\n```bash\nsudo dpkg -i hcp_1.0.0\\(7\\).deb \n(Reading database ... 316541 files and directories currently installed.)\nPreparing to unpack hcp_1.0.0(7).deb ...\nUnpacking hcp (1.0.0) over (1.0.0) ...\nSetting up hcp (1.0.0) ...\n\nAfter install, enable and start the service with:\n  sudo systemctl daemon-reload\n  sudo systemctl enable hcp@proshan.service\n  sudo systemctl start hcp@proshan.service\n\n```\n\nif you follow it properly you would see something like below\n```bash \nsudo systemctl status hcp@proshan.service\n[sudo] password for proshan: \n● hcp@proshan.service - HCP Clipboard Manager Service\n     Loaded: loaded (/etc/systemd/system/hcp@proshan.service; enabled; vendor preset: enabled)\n     Active: active (running) since Fri 2025-07-04 02:50:03 IST; 6min ago\n   Main PID: 3150329 (hcp)\n      Tasks: 1 (limit: 38063)\n     Memory: 292.0K\n     CGroup: /system.slice/system-hcp.slice/hcp@proshan.service\n             └─3150329 /usr/bin/hcp service start\n\nJul 04 02:50:03 twi-proshan systemd[1]: Started HCP Clipboard Manager Service.\n```\n### List Clipboard History\n```sh\nhcp list\n```\n\n### Print a Specific Clipboard Entry\nPrint the Nth entry (as shown in the list):\n```sh\nhcp \u003cindex\u003e\n# Example:\nhcp 2\n```\n\n## How It Works\n- Clipboard entries are saved in `~/.hcp/history.block` as binary blocks.\n- Each entry is stored as: 4-byte length (uint32_t) followed by the clipboard content data.\n- The format allows efficient appending and reading of the entire history in reverse chronological order.\n- The service logs events to `~/.hcp/service.log`.\n\n## Troubleshooting\n- If `~/.hcp/history.block` is not created, check `~/.hcp/service.log` for errors.\n- You can check service log using `sudo systemctl status hcp.service` \n\n## License\nSee [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagent-hellboy%2Fhcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagent-hellboy%2Fhcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagent-hellboy%2Fhcp/lists"}