{"id":13551483,"url":"https://github.com/ms-jpq/isomorphic_copy","last_synced_at":"2025-04-10T01:07:24.580Z","repository":{"id":38179556,"uuid":"270858928","full_name":"ms-jpq/isomorphic_copy","owner":"ms-jpq","description":"Cross platform clipboard | networkless! remote copy","archived":false,"fork":false,"pushed_at":"2024-10-15T12:53:32.000Z","size":621,"stargazers_count":230,"open_issues_count":6,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-10T01:07:18.471Z","etag":null,"topics":["clipboard","tmux","vim","xclip"],"latest_commit_sha":null,"homepage":"","language":"Python","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/ms-jpq.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":"2020-06-08T23:56:49.000Z","updated_at":"2025-04-01T19:33:41.000Z","dependencies_parsed_at":"2024-01-13T03:25:54.713Z","dependency_job_id":"85bce822-40d8-4744-8518-9cf627c0f122","html_url":"https://github.com/ms-jpq/isomorphic_copy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ms-jpq%2Fisomorphic_copy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ms-jpq%2Fisomorphic_copy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ms-jpq%2Fisomorphic_copy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ms-jpq%2Fisomorphic_copy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ms-jpq","download_url":"https://codeload.github.com/ms-jpq/isomorphic_copy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248137887,"owners_count":21053775,"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":["clipboard","tmux","vim","xclip"],"created_at":"2024-08-01T12:01:49.175Z","updated_at":"2025-04-10T01:07:24.564Z","avatar_url":"https://github.com/ms-jpq.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# [Isomorphic Copy](https://ms-jpq.github.io/isomorphic-copy)\n\n**Cross platform clipboard.**\n\n**Both remote and local**\n\n**Works out of the 📦** with most programs that use `pbcopy`, `xclip`, `wl-copy`, etc.\n\nWorks the same locally as over SSH, inside Docker containers, et al.\n\nIt even works inside Docker over SSH and then inside Docker!, **infinitely chainable**.\n\n![clippy](https://raw.githubusercontent.com/ms-jpq/isomorphic-copy/master/preview/clippy.jpg)\n\n---\n\n## Networkless\n\n`isomorphic-cp` communicates by `stdio`  and `unix socket` only!\n\nAll it does is spawn subprocesses and listen to `IO`.\n\nThis makes it amazingly versatile.\n\n![diagram](https://raw.githubusercontent.com/ms-jpq/isomorphic-copy/master/preview/diagram.png)\n\n---\n\n## Daemonless\n\nYou literally just run `cssh \u003cssh-args\u003e` or `cdocker \u003ccontainer-name\u003e`.\n\nNo local daemon required. The remote \"daemon\" is just a subprocess of a subprocess. Zero cost when you are not using it.\n\n---\n\n## How to use\n\nRequires `xclip` or `wl-clipboard` under GUI linux.\n\n**Clone** this repo to the same location on two machines. Either relative to `~` or `/`.\n\n**Prepend** `isomorphic-copy/bin` to your `PATH` for example:\n\n`export PATH=\"$XDG_CONFIG_HOME/isomorphic-copy/bin:$PATH\"` in your `bash/zshrc` file.\n\nYou need to do this on both local and remote.\n\n--\n\n**Automatically** most applications that use `xclip`, `wl-clipboard`, `pbcopy` and so forth will use `isomorphic-copy` with zero setup.\n\nWorks just like python `virtualenv`!\n\n--\n\nI added two **convenience functions**:\n\nYou don't have to use these. Things like `pbcopy` and `pbpaste` will continue to work.\n\n`echo \u003cmy message\u003e | c` Use `c` to copy to system clipboard\n\n\n`p \u003e my_message.txt` Use `p` to paste from system clipboard\n\n--\n\n**Connect to remote** with one of\n\n`cssh \u003cssh-args\u003e`\n\n`cdocker \u003cdocker container name\u003e`\n\nOnce daemon is launched, remote copy will propagate to local system clipboard.\n\nRemote applications that use `xclip`, `pbcopy`, `wl-copy` will propagate to local system clipboard.\n\n--\n\n**Local -\u003e SSH -\u003e Docker**\n\nIf you want to copy from a `Docker` container on a remote machine.\n\nfrom local run `cssh \u003cssh-args\u003e` to remote\n\nfrom remote run `cdocker \u003ccontainer name / sha\u003e` to container\n\nAnd you are set!\n\n\n## Integrations\n\n### Tmux\n\nCopy will automatically propagate to local / remote tmux clipboard.\n\nIf daemon is run under tmux, copy will also propagate to the local tmux clipboard.\n\nIf no system clipboard is available, copy / paste will use tmux clipboard.\n\nCopying *FROM* tmux will require this snippet.\n\n```conf\nset -g mouse on\n\nbind -T copy-mode MouseDragEnd1Pane \\\n  send-keys -X stop-selection\n\nbind -T copy-mode MouseDown1Pane \\\n  select-pane \\;\\\n  send-keys -X copy-pipe \"c\" \\;\\\n  send-keys -X clear-selection\n```\n\nDrag to select, click in dragged area to copy.\n\nReplace `copy-mode` with `copy-mode-vi` if you are using vi emulation.\n\n### Vim\n\nNeovim will only use `xclip` if the x11 environmental variable `DISPLAY` is set.\n\nVim will require an autocmd event.\n\nAdd this snippet to your `vimrc`, to work for both vims.\n\n```viml\nif has('nvim')\n  \" use unnamedplus only! or else will double set\n  set clipboard=unnamedplus\n  if getenv('DISPLAY') == v:null\n    exe setenv('DISPLAY', 'FAKE')\n  endif\nelse\n  autocmd TextYankPost * call system(\"c\", getreg('\"'))\nendif\n```\n\n### Others\n\nMost CLI applications will work out of the box. (such as lazygit, for example).\n\nIf not, check if they require `DISPLAY` like Neovim.\n\n### Fallback\n\nIf no system / tmux clipboard is found, setting environmental variable `ISOCP_USE_FILE=1` will enable using a temp file as a crude clipboard.\n\nIt will write inside the git repo, put it somewhere safe.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fms-jpq%2Fisomorphic_copy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fms-jpq%2Fisomorphic_copy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fms-jpq%2Fisomorphic_copy/lists"}