hluk/CopyQ

GitHub: hluk/CopyQ

跨平台高级剪贴板管理器,支持历史记录、多格式存储、脚本自动化和命令行操作。

Stars: 11414 | Forks: 551

# CopyQ [![文档状态](https://readthedocs.org/projects/copyq/badge/?version=latest)](https://copyq.readthedocs.io/en/latest/?badge=latest) [![翻译状态](https://hosted.weblate.org/widgets/copyq/-/svg-badge.svg)](https://hosted.weblate.org/engage/copyq/?utm_source=widget) [![Linux 构建状态](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/d66cf00a33185614.svg)](https://github.com/hluk/CopyQ/actions?query=branch%3Amaster+event%3Apush+workflow%3ALinux) [![macOS 构建状态](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/b9d59bd89f185615.svg)](https://github.com/hluk/CopyQ/actions?query=branch%3Amaster+event%3Apush+workflow%3AmacOS) [![Windows 构建状态](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/3991a2d7e7185616.svg)](https://github.com/hluk/CopyQ/actions?query=branch%3Amaster+event%3Apush+workflow%3AWindows) [![覆盖率状态](https://codecov.io/gh/hluk/CopyQ/branch/master/graph/badge.svg)](https://codecov.io/gh/hluk/CopyQ) CopyQ 是一款高级剪贴板管理器,具备强大的编辑和脚本功能。 - [下载](https://github.com/hluk/CopyQ/releases) - [网站](https://hluk.github.io/CopyQ/) - [文档](https://copyq.readthedocs.io) - [邮件列表](https://groups.google.com/group/copyq) - [Bug 报告](https://github.com/hluk/CopyQ/issues) - [捐赠](https://liberapay.com/CopyQ/) - [脚本 API](https://copyq.readthedocs.io/en/latest/scripting-api.html) ## 概述 * CopyQ 监控系统剪贴板并将其内容保存到自定义的标签页中。 * 保存的剪贴板条目稍后可以直接复制并粘贴到任何应用程序中。 ## 功能特性 * 支持 Linux、Windows 和 [macOS 13+](https://doc.qt.io/qt-6/macos.html) * 存储文本、HTML、图像以及任何其他自定义格式 * 快速浏览和过滤剪贴板历史记录中的项目 * 在标签页中对项目进行排序、创建、编辑、删除、复制/粘贴、拖放操作 * 为项目添加笔记和标签 * 支持系统全局快捷键和自定义命令 * 通过快捷键、系统托盘或主窗口粘贴项目 * 完全可自定义的外观 * 高级命令行界面和脚本功能 * 忽略从特定窗口复制或包含特定文本的剪贴板内容 * 支持带有快捷键的简单 Vim 风格编辑器 * 以及更多功能 ## 安装 Packaging status 要安装 CopyQ,请使用为您的操作系统提供的二进制包或安装程序。 对于未列出的操作系统,请按照以下说明操作: [从源代码构建](https://copyq.readthedocs.io/en/latest/build-source-code.html)。 ### Windows [![Chocolatey 包](https://repology.org/badge/version-for-repo/chocolatey/copyq.svg)](https://repology.org/metapackage/copyq) 在 Windows 上,您可以使用以下任一选项来安装 CopyQ: * [安装程序 (setup.exe)](https://github.com/hluk/CopyQ/releases) * [便携版 zip 包](https://github.com/hluk/CopyQ/releases) * 来自 [extras bucket](https://github.com/lukesampson/scoop-extras) 的 [Scoop 包](https://scoop.sh/)。 * [Chocolatey 包](https://chocolatey.org/packages/copyq) 使用 Scoop: ``` scoop install copyq ``` 使用 Chocolatey: ``` choco install copyq ``` ### macOS 支持 macOS 13 及更高版本(这主要取决于 [Qt 版本](https://doc.qt.io/qt-6/macos.html))。 [![Homebrew 包](https://repology.org/badge/version-for-repo/homebrew_casks/copyq.svg)](https://repology.org/metapackage/copyq) 在 macOS 上,您可以使用 [Homebrew](https://brew.sh/) 来安装 CopyQ: ``` brew install --cask copyq ``` 如果您遇到应用程序崩溃并弹出对话框提示“CopyQ is damaged”或“CopyQ cannot be opened”,您可能需要运行以下 命令(详情请参阅 #2652): ``` xattr -d com.apple.quarantine /Applications/CopyQ.app codesign --force --deep --sign - /Applications/CopyQ.app ``` ### Debian 11+、Ubuntu 22.04+ 及其衍生版本 安装 `copyq` 和 `copyq-plugins` 包。 #### Ubuntu PPA 通过从终端运行以下命令来安装并保持 CopyQ 始终更新(来自 PPA 的包包含所有插件和文档): ``` sudo apt install software-properties-common python-software-properties sudo add-apt-repository ppa:hluk/copyq sudo apt update sudo apt install copyq # 此软件包包含所有插件和文档 ``` ### Fedora 安装 `copyq` 包。 ### Arch Linux 安装 `copyq` 包。 ### 其他 Linux 发行版 安装 [Flatpak](https://flatpak.org/) 并从 [Flathub](https://flathub.org/) 安装 `com.github.hluk.copyq`。 ``` flatpak install flathub com.github.hluk.copyq ``` 从菜单或使用以下命令启动 CopyQ: ``` flatpak run com.github.hluk.copyq ``` ## 使用应用程序 要启动 CopyQ,请双击程序图标或运行 `copyq`。 通过单击系统托盘图标或运行 `copyq toggle` 可以访问剪贴板历史记录列表。 将文本或图像复制到剪贴板将在列表中创建一个新项目。 选定的项目可以: * 被编辑 (`F2`) * 被删除 (`Delete`) * 被排序 (`Ctrl+Shift+S`, `Ctrl+Shift+R`) * 被重新定位(使用鼠标或 `Ctrl+Up/Down`) * 被复制回剪贴板 (`Ctrl+C`) * 被粘贴到之前的活动窗口 (`Enter`) 当 CopyQ 下次启动时,所有项目都将被恢复。 要退出 CopyQ,请从托盘菜单中选择 Exit(退出),或在 CopyQ 窗口中按 `Ctrl-Q`。 了解更多: - [基本用法](https://copyq.readthedocs.io/en/latest/basic-usage.html) - [键盘](https://copyq.readthedocs.io/en/latest/keyboard.html) ### 添加功能 要创建可以从菜单、快捷键或剪贴板变化时执行的自定义操作: - 进入 Command(命令)对话框(`F6` 快捷键) - 点击 `Add`(添加)按钮,然后选择一个预定义命令或创建一个新命令 - 可选地修改命令详细信息(快捷键、名称) - 点击 `OK`(确定)保存命令 其中一个非常有用的预定义命令是 "Show/hide main window"(显示/隐藏主窗口)。 了解更多: - [编写命令](https://copyq.readthedocs.io/en/latest/writing-commands-and-adding-functionality.html) - [CopyQ 命令仓库](https://github.com/hluk/copyq-commands) ### 命令行 CopyQ 拥有强大的命令行和脚本接口。 注意:主应用程序必须处于运行状态,才能通过命令行执行命令。 打印一些有用命令行参数的帮助信息: ``` copyq --help copyq --help add ``` 在历史记录中插入一些文本: ``` copyq add -- 'first item' 'second item' 'third item' ``` 在上述命令中省略双破折号 (`--`) 意味着参数中的反斜杠 (`\`) 将被视为特殊字符。例如,`\n` 将被视为 换行符,`\t` 为制表符,`\\` 为斜杠,`\x` 为 `x` 等。 创建一个包含两行的单个项目: ``` copyq add 'first line\nsecond line' ``` 打印前三个项目的内容: ``` copyq read 0 1 2 copyq separator "," read 0 1 2 ``` 显示当前剪贴板内容: ``` copyq clipboard copyq clipboard text/html copyq clipboard \? # lists formats in clipboard ``` 复制文本到剪贴板: ``` copyq copy "Some Text" ``` 将文件内容加载到剪贴板: ``` copyq copy - < file.txt copyq copy text/html < index.html copyq copy image/jpeg - < image.jpg ``` 创建图像项目: ``` copyq write image/gif - < image.gif copyq write image/svg - < image.svg ``` 了解更多: - [脚本](https://copyq.readthedocs.io/en/latest/scripting.html) - [脚本 API](https://copyq.readthedocs.io/en/latest/scripting-api.html) ## 从源代码构建 请参阅文档部分 [从源代码构建](https://copyq.readthedocs.io/en/latest/build-source-code.html)。 ## 贡献 您可以帮助翻译 CopyQ(点击下方的横幅) 或帮助 [修复问题并实现新功能](https://github.com/hluk/CopyQ/issues)。 [![翻译](https://hosted.weblate.org/widgets/copyq/-/287x66-white.png)](https://hosted.weblate.org/engage/copyq/?utm_source=widget) 了解更多: - [从源代码构建](https://copyq.readthedocs.io/en/latest/build-source-code.html) - [修复 Bug 和添加功能](https://copyq.readthedocs.io/en/latest/fixing-bugs.html) - [翻译](https://copyq.readthedocs.io/en/latest/translations.html)
标签:C++, CopyQ, GauPlus, Linux 软件, macOS 软件, Windows 软件, 剪切板历史记录, 剪贴板监控, 剪贴板管理, 剪贴板编辑, 复制粘贴, 多格式支持, 效率, 数字取证, 数据可视化, 数据擦除, 文本管理, 桌面增强, 生产力工具, 系统托盘, 自动化脚本, 键盘快捷键