{"id":22705570,"url":"https://github.com/benhoff/dev_clipboard","last_synced_at":"2025-03-29T20:25:40.448Z","repository":{"id":266921553,"uuid":"899771589","full_name":"benhoff/dev_clipboard","owner":"benhoff","description":"create a clipboard for users for systems that don't have wayland or xorg installed","archived":false,"fork":false,"pushed_at":"2025-01-21T18:49:01.000Z","size":103,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-04T21:18:39.810Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/benhoff.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-12-07T01:31:05.000Z","updated_at":"2025-01-21T18:49:05.000Z","dependencies_parsed_at":"2024-12-07T02:24:16.918Z","dependency_job_id":"880e52f1-a7fc-4b99-8389-7ac23f716768","html_url":"https://github.com/benhoff/dev_clipboard","commit_stats":null,"previous_names":["benhoff/dev_clipboard"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benhoff%2Fdev_clipboard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benhoff%2Fdev_clipboard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benhoff%2Fdev_clipboard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benhoff%2Fdev_clipboard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benhoff","download_url":"https://codeload.github.com/benhoff/dev_clipboard/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246239482,"owners_count":20745717,"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","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":"2024-12-10T09:11:39.931Z","updated_at":"2025-03-29T20:25:40.427Z","avatar_url":"https://github.com/benhoff.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Dev Clipboard Kernel Module\n\nDev Clipboard is a Linux kernel module that provides a per-user clipboard device. It allows each user to have their own isolated clipboard buffer, ensuring that one user's clipboard data is inaccessible to others.\n\n- Per-User Isolation: Each user has a separate clipboard buffer identified by their UID.\n- Efficient Data Management: Utilizes a hash table with per-bucket mutexes for fast and concurrent access.\n- Dynamic Buffer Management: Automatically resizes clipboard buffers up to a configurable maximum capacity.\n- IOCTL Interface: Provides an IOCTL command to clear the clipboard buffer from user space.\n\n#### Usage\n\nA device file /dev/clipboard is created, allowing user-space applications to interact with the clipboard.\n\nTo read data from your clipboard:\n\n`cat /dev/clipboard`\n\nTo write data to your clipboard:\n\n`echo \"Your clipboard text\" \u003e /dev/clipboard`\n\nThis command writes the specified text to your clipboard buffer.\n\n#### Installation\n\nOption 1: Automated Installation via Bootstrap Script\n\nYou can use the provided bootstrap script. This script automates the process of installing dependencies, setting up DKMS, downloading the project, building and installing the module, and configuring it to load on startup.\n\n```bash\ncurl -sSL https://raw.githubusercontent.com/benhoff/dev_clipboard/refs/heads/master/bootstrap.sh | bash\n\n# Alternatively, using wget:\nwget -qO- https://raw.githubusercontent.com/benhoff/dev_clipboard/refs/heads/master/bootstrap.sh | bash\n```\n\nOption 2: Manual installation\n\nPre-reqs include:\n- Linux Kernel Headers: Ensure that the kernel headers matching your current kernel version are installed.\n- Build Essentials: make, gcc, and other development tools.\n- Root Privileges: Installing and loading kernel modules require root access.\n- (optional) DKMS\n  \n```bash\n# Arch Linux\nsudo pacman -Syu linux-headers\n\n# Fedora\nsudo dnf install kernel-headers kernel-devel\n\n# Debian/Ubuntu\nsudo apt-get update\nsudo apt-get install linux-headers-$(uname -r)\n\n# Optionally, install DKMS\n# Arch\nsudo pacman -Syu dkms\n\n# Fedora\nsudo dnf install dkms\n\n# Debian/Ubuntu\nsudo apt-get install dkms\n\n```\n\n1. Clone the Repository\n\n```bash\ngit clone https://github.com/benhoff/dev_clipboard.git\ncd dev_clipboard\n```\n\n2. Build the Module using make or DKMS\n\nEither use the provided Makefile to compile the kernel module.\n\n```\ncd src \u0026\u0026 make \u0026\u0026 make install\n```\n\n-Or- use DKMS\n```\n# Add the module to DKMS\nsudo dkms add -m clipboard -v 3.0\n\n# Build the module using DKMS\nsudo dkms build -m clipboard -v 3.0\n\n# Install the module using DKMS\nsudo dkms install -m clipboard -v 3.0\n```\n\nLoad the clipboard module into the kernel.\n\n`sudo modprobe clipboard`\n\n\n\nClearing the Clipboard\n\nTo clear your clipboard buffer, use the provided IOCTL command.\n\nNeed more Maximum Capacity per User?\n\nSymptoms:\n\nWrite operations fail with -ENOMEM.\nClipboard cannot be resized further.\n\nSolution:\n\nThe module enforces a maximum clipboard capacity (MAX_CLIPBOARD_CAPACITY). To increase this limit, modify the clipboard.h file and recompile the module.\n\n#define MAX_CLIPBOARD_CAPACITY (10 * 1024 * 1024) // 10 MB\n\nAfter making changes, rebuild and reinstall the module.\n\n#### Contributing\n\nContributions are welcome! If you encounter issues or have suggestions for improvements, feel free to open an issue or submit a pull request.\nLicense\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenhoff%2Fdev_clipboard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenhoff%2Fdev_clipboard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenhoff%2Fdev_clipboard/lists"}