copyq-commands

hluk更新放缓

给 CopyQ 剪贴板管理器用的一组实用脚本命令,能自动处理剪贴板内容,省去手动整理和重复操作。

Useful commands for CopyQ clipboard manager.

暂无版本504star84fork同步于 2026-11-07 07:33 UTC

怎么上手

由 README 提炼,执行前请确认
复制以 [Command] 或 [Commands] 开头的命令代码,在 CopyQ 中按 F6 打开命令对话框,点击 Paste Commands 或按 Ctrl+V 粘贴后应用
硬件要求按 README 说明

README 未说明。部分命令依赖外部程序:OCR 需 GraphicsMagick 与 Tesseract,解密输入需 Linux/X11 的 xdotool,Markdown 转换与代码高亮需 Python 及 mistletoe、Pygments。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

CopyQ 剪贴板管理器的实用命令脚本合集,粘贴导入即可扩展剪贴板功能

给 CopyQ 剪贴板管理器用的一组实用脚本命令,能自动处理剪贴板内容,省去手动整理和重复操作。

核心能力

  • 复制以 [Command] 开头的代码后在 CopyQ 中按 F6 粘贴导入
  • 提供备份退出、定时清空剪贴板、大文本单独分标签等自动化命令
  • 支持 Markdown 转 HTML、Jira、LaTeX 等格式
  • 可按窗口标题自动归类剪贴板内容到对应标签
  • 含密码/令牌识别忽略与 KeePassXC 保护命令

容易踩的坑

本仓库只是命令脚本集合,必须先安装 CopyQ 本体才能使用;Markdown 转换、代码高亮、OCR 等命令需另行安装 Python 包或外部工具;部分命令仅限 Linux/X11,如 xdotool 解密输入与忽略非鼠标选区

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

0 个版本

暂无 release 数据(可能没有发版,或尚未同步)。

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Useful commands for CopyQ clipboard manager.

    You can share your commands and ideas here. Just open pull request or an issue.

    For the list of commands see Commands section below.

    Add a Command to CopyQ

    To add a command to CopyQ:

    • copy the command code (starts with [Command] or [Commands] for multiple commands),
    • open CopyQ,
    • open Command dialog (F6 shortcut),
    • click "Paste Commands" button (or Ctrl+V),
    • apply changes.

    To simplify this add command which shows notification with button to import all commands copied to clipboard. This also works if you just copy a link with commands.

    Select Category Copy Command Link Import Command Notification

    Write new Commands

    See following documentation about writing commands and scripting.

    Submit new pull request in this repository if you want to share a command.

    Commands

    Activate Nth Item

    Press a digit key (0-9) in the main window to instantly activate and paste the item at that row index.

    Respects row_index_from_one configuration.

    Auto Preview Image or Long-text

    Automatically preview images and long-text, and support manual preview with Space key. You can set the number of lines and characters for long text.

    // More than 100 characters and 2 lines are considered as long text
    var LongTextCharacters = 100
    var LongTextLines = 2
    

    Backup On Exit

    Backs up items and configuration on exit.

    Big Data Tab

    Automatically moves larger amount of data copied to clipboard to a special tab (see the command variables to set the output tab and size limit) to keep the access to primary clipboard tab swift.

    Blocklisted Texts

    Blocklists clipboard text to omit adding it in item list and avoid running automatic commands on it.

    Only checksum of the text (salted) is stored in the blocklist so this can be safely used with passwords (the texts are not stored anywhere).

    Bookmarks

    Allows you to set a mark on an item, then later restore that mark to the clipboard.

    The implementation uses special tags with a "mark:" prefix, and when a mark is set, removes that tag from any items that contain that tag.

    Capitalize Selected Text for Titles

    E.g. changes "Do androids dream of electric sheep?" to "Do Androids Dream of Electric Sheep?".

    Change Upper/Lower Case of Selected Text

    Toggles between upper- and lower-case letters in selected text.

    Clear Clipboard After Interval

    Clears clipboard after an interval (30 seconds by default).

    Clear Clipboard Tab

    Remove all items from clipboard tab using menu item (or custom shortcut).

    Clipboard Notification

    Persistently displays notification with clipboard (and X11 selection) content.

    Convert Markdown to ...

    Converts text written in Markdown syntax to desired format, which can be for example:

    • HTML
    • Jira markup
    • JSON (AST) (JSON representation of the parsed text; useful rather for contributors than users)
    • LaTeX

    The command can be run on any text selection via a global shortcut or over items selected in the main window.

    Installation

    This script relies on the mistletoe project to do the actual Markdown parsing and conversion. This in turn requires that Python is installed on the user computer.

    See mistletoe's page linked above for the various possibilities of its installation.

    For output format "HTML + code highlighting", an additional Python package needs to be installed:

    pip3 install pygments
    

    Copy Clipboard to Window Tabs

    Automatically adds new clipboard to tab with same name as title of the window where copy operation was performed.

    Copy Text in Image

    Takes screenshot of selected part of the screen and tries to recognize text.

    Requires GraphicsMagick and Tesseract.

    Copy a Secret

    Copies (by default with Ctrl+Shift+C) from current window without storing or showing the data in GUI.

    Copy a Secret If a Modifier Held

    If any keyboard modifier (Ctrl, Shift, Alt etc) is held for a second after copying a content, it will not be stored or shown in GUI.

    Copy and Paste Items in JSON Format

    Allows to easily share items in readable text format.

    Copy and Search on Web

    Copies currently selected text and opens selection menu to search the text on some well-known websites. New search queries can be easily defined.

    Cycle Items

    Pops up the main window (if the shortcut is pressed once), cycles through items (if the shortcut is pressed again) and pastes selected item when the shortcut is released.

    See: https://github.com/hluk/CopyQ/issues/1948

    Cycle Items - Quick

    Like Cycle Items command but previews items to copy in popups without showing the main window.

    Decrypt and Type

    Safely types in decrypted text of selected item instead of using clipboard.

    Requires "xdotool" utility which works only on Linux/X11.

    Diff Latest Items

    Compares two clipboard history items with your preferred diff tool.

    The latest two items get compared when the command is run as a global command. You can also run the command on any two items selected in the main window.

    By default, this command launches Beyond Compare 4 for doing the comparison. You can find examples of launching other tools like WinMerge directly in the command's source code.

    Disable Monitoring State Permanently

    Disables clipboard monitoring permanently, i.e. the state is restored when clipboard changes even after application is restarted.

    Edit Files

    Opens files referenced by selected item in external editor (uses "External editor command" from "History" config tab).

    Works with following path formats (some editors may not support all of these).

    • C:/...
    • file://...
    • ~... (some shells)
    • %...%... (Windows environment variables)
    • $... (environment variables)
    • /c/... (gitbash)

    Edit Tag

    Replace an existing tag with another (with a custom text).

    Edit and Paste

    Following command allows to edit current clipboard text before pasting it.

    If the editing is canceled the text won't be pasted.

    Filter

    Add a filter menu to quickly filter images, URLs, files, etc.

    You can customize the filters:

    var filter1= {
        [mimeText]: 'File  ---------------- F',    //Text displayed on the menu
        [mimeIcon]: '',
        filter: '(?=^file://)',    //Regular expression of the filter
        shortcut: 'f'    //You need to set the menu shortcut of this command at the same time.
    }
    
    var filters = [filter1, filter2, filter3, ...]    //Add filters to the list
    

    Full Clipboard Text in Title and Tooltip

    Shows full clipboard text in window title and tray tooltip.

    Hide/Show Item Content

    Hides (or shows if hidden) item content except notes and tags.

    Highlight Code

    Highlights syntax for recognized code.

    Requires Python and Pygments.

    Highlight Text

    Highlights all occurrences of a text (change x = "text" to match something else than text).

    Ignore Images when Text is Available

    This is useful for ignoring cells copied as images from Microsoft Excel and LibreOffice Calc.

    Ignore Non-Mouse Text Selection

    Linux/X11 only. Some web or other applications can automatically set X11 mouse selection buffer. This can be quiet annoying so this command tries to reset the buffer to previous content when this happens.

    Ignore Passwords/Tokens

    Ignore the clipboard if it contains a password or token based on the text characteristics (length, uppercase letters, digits).

    Image Tab

    Automatically store images copied to clipboard in a separate tab.

    Import Commands after Copied to Clipboard

    Shows notification allowing to easily import commands just copied to clipboard.

    The copied text can be either link to a command on github or starts with [Command] or [Commands].

    Indicate Copy in Icon

    Indicates a copy operation by changing the icon tag.

    Join Selected Items

    Creates new item containing concatenated text of selected items.

    Change the separator variable to separate the merged items with a different string than line break \n.

    KeePassXC protector

    A plugin that prevents saving data from the KeePassXC password manager.

    Keep Item in Clipboard

    Keeps the first item (can be pinned) in clipboard at start and after a copy operation (after custom interval).

    Linkify

    Creates interactive link from plain text.

    Make a selected tab a clipboard tab and put the first item on the clipboard

    Make the selected tab a clipboard tab and put the first item on the clipboard.

    Mark Selected Items

    Toggles highlighting of selected items.

    Modify Selected Items

    A template command to modify selected items in some way.

    This is only a template: change body of modifySelectedItemData() function to replace the item data in a specific way.

    Modify Selected Text

    A template command to modify selected text and paste it back.

    This is only a template: change body of modifyText() function to replace the text in a specific way.

    Navigate Tabs With Alt+Number

    Enables Alt+1 .. Alt+9, Alt+0 to navigate to the tab based on the order (instead of the default Ctrl+Number navigation).

    Next/Previous

    Remaps Up/Down arrows for browsing items to Ctrl+P/Ctrl+N or other custom shortcuts.

    No Clipboard in Title and Tool Tip

    Stop showing current clipboard content in window title and tray tool tip.

    Paste Current Date and Time

    Copies current date/time text to clipboard and pastes to current window on global shortcut Win+Alt+T.

    Paste Current Date and Time in ISO8601 Format

    Copies current date/time in ISO8601 format to clipboard, adds it to the clipboard history, and then pastes it to the current window.

    Paste Formatted Json

    Pastes selected Json text as a formatted Json text. If not Json, just pastes the text as is.

    Paste Nth Item

    Paste items 1-9 in history using ctrl+1 through ctrl+9 shortcuts.

    Paste and Forget

    Pastes selected items and clear clipboard.

    Paste new UUID

    Generates a new RFC4122 version 4 compliant UUID, adds it to the clipboard history, copies it to the clipboard and pastes it to the current window. Full credit for UUID generation code goes to Jeff Ward (jcward.com), link: https://stackoverflow.com/a/21963136/11820711

    Play Sound when Copying to Clipboard (Built-in)

    Plays a sound using CopyQ's built-in playSound() whenever something is copied to the clipboard. Supports wav, mp3 and flac files. No external dependencies required.

    Change soundFilePath and volume (0–100) in the command to customize.

    Play Sound when Copying to Clipboard - Linux

    Following command will play an audio file whenever something is copied clipboard.

    Requires mpv utility.

    Play Sound when Copying to Clipboard - Windows

    Plays a user-specified audio file whenever something is copied to the clipboard. If native notifications are enabled, this adds to their associated sound rather than replacing it.

    Preview Image Files

    Shows images instead of just a path (works with file://...).

    Push/Pop Items

    A global shortcut to copy selected text/HTML/image as a new top item in "Stack" tab and another shortcut to paste the top item and remove it from the tab.

    See: https://github.com/hluk/CopyQ/issues/597

    QR Code

    From currently selected text items, creates a new item with the QR code for the text.

    Requires qrcode utility.

    Quick Save

    Saves an item as file to a preset path using available tags as it's file name, without overwriting. There is no user input dialog. This works great along the script show window title which saves source window title to tags while adding to clipboard. After installation, you must edit default folder (xyz) path: currentPath('C:/abc/xyz')

    Other options: Number of words to use from tags (not number of tags): var words = 3 Default file name if there are no tags: var defaultname = 'clip'

    Quickly Show Current Clipboard Content

    Quickly pops up notification with text in clipboard using Win+Alt+C system shortcut.

    Remember Clipboard Storing State

    Normally, if "Clipboard Storing" is disabled from File menu, it will be re-enabled automatically on the application start next time.

    This command makes the last set state persistent between application launches.

    Remove Background and Text Colors

    Removes background and text colors from rich text (e.g. text copied from web pages).

    Command can be both automatically applied on text copied to clipboard and invoked from menu (or using custom shortcut).

    Remove Carriage Return, Line Feed and Multiple Space Then Paste

    Removes carriage return, line feed and multiple space in the clipboard, then paste it.

    Useful when copy texts from PDF.

    Render HTML

    Converts text item with HTML code to HTML item.

    Render Markdown

    Renders markdown if recognized.

    Requires marked.

    Replace All Occurrences in Selected Text

    Reset Empty Clipboard/Selection

    Automatically restores previous clipboard text if cleared. Also restores the primary selection if cleared.

    Save Item/Clipboard To a File

    Opens dialog for saving selected item data to a file.

    Screenshot

    Take screenshot of the screen.

    Screenshot Cutout

    Take screenshot of selected part of the screen.

    Search & Replace

    Search and replace specified text in the currently selected items or all items in the current tab.

    Search All Tabs

    Searches an text in all tabs and stores found items in "Search" tab.

    Select Nth Item

    Overrides main window shortcuts Ctrl+1..9 to quickly select items in specific row.

    Select Nth Item - Global Shortcuts

    Quick shortcuts to activate items 0 to 9 (copy, move to top and paste depending on preferences in History configuration tab).

    Show Character Code

    Shows Unicode code info for the first characters of any text. An example of how this looks like:

    Show Character Code Dialog

    Show Clipboard

    Shows notification with current clipboard content (text or image).

    Show Window Title

    Shows source application window title for new items in tag.

    Requires "Tags" plugin.

    Show on Start

    Show main window after application starts.

    Snippets

    Shows dialog with snippets to paste.

    Snippets are loaded from "Snippets" tab. Item notes are used as snippet name.

    Items can contain placeholders like:

    • ${Name} (default text is empty),
    • ${Name:value} (default text is "value"),
    • ${Name:value1,value2,value3} (default text is "value1"; allows to select from multiple values),
    • ${Name:\n} (multi-line text field).

    When such snippet is selected, user is prompted to replace these placeholders with custom content.

    To create your first snippet:

    1. create "Snippets" tab (Ctrl+T),

    2. add new item (Ctrl+N) with a snippet:

      You picked ${Fruit:apples,oranges,pears}!

    3. set optional snippet name (Ctrl+F2), e.g. "Fruit".

    Triggering the Snippets command (with a global shortcut) will show a simple dialog where you can pick the snippet by its name.

    To pick different tab name, you have to change the command's code.

    var snippetsTabName = '&Snippets'
    

    Sort Items

    Sort items based on copy time, size, pinned status, etc.

    • When selecting single item, sort the entire tab
    • When selecting multiple items, only sort the selected items

    Sort Tabs

    Sorts tabs by name.

    Split Item to Lines

    Split selected items to separate lines (new item for each line).

    Stopwatch

    Restarts stopwatch and copies elapsed time since last started.

    Store Copy Time

    Store the copy time of new items in a tag.

    To show tags in the item list the Tags plugin is required.

    Optionally you can change the appearance of the copy time tag. See this example:

    Tag Name: \1

    Match: (\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2})

    Style Sheet: font-size: 9pt; color: #fff; border: 1px solid #000; background: #000; padding: 0 2px

    Store Mouse Selections in Separate Tab

    Stores Linux/X11 mouse selections in a separate tab.

    Synchronize Clipboard with Other Sessions

    Synchronizes clipboard with other application session running on different X11 servers.

    Tab Key to Select Next/Previous

    Use Tab and Shift+Tab to select next/previous item.

    Tab Switcher

    Use a shortcut or a toolbar action to quickly find a tab and focus it on Enter key or double click.

    This uses a separate CopyQ session/app-instance to show the tab list.

    Tab for Frequent Items

    Two commands to add frequent items to special tab and to show frequent items with global shortcut.

    Tab for URLs with Title and Icon

    For copied URLS tries to get web page title and icon and stores it with item in "url" tab.

    Tabs navigation

    Global shortcuts to select tabs. It is possible to select the Nth tab by order and the next or previous tab.

    Toggle Clipboard Storing

    Toggles clipboard storing/monitoring with global shortcut or from menu/toolbar.

    Toggle Show As Plain Text

    Display command combined with a shortcut that changes how selected items are displayed: as plain text or rich text (HTML).

    Toggle Simple Items

    Show/hide more compact items (one line of text or thumbnail).

    Toggle Tag

    Instead of two commands, one to tag and other to untag selected items, and see two actions in toolbar, you can use this command to toggle a tag.

    Top Item to Clipboard

    Whenever a new top item is added to the clipboard tab or is changed, it is also copied to the system clipboard.

    Translate to English

    Passes text to Google Translate.

    Treefy

    Convert indented line block (tabs, spaces or markdown headers) to an ASCII directory tree with the possibility to add a root element.

    Example

    A1
      B1
        C1
          D1
            E1
          D2
            E2
    Z1
      Y1
        X1
    

    Output (with root)

    .
    ├─ A1
    │  └─ B1
    │     └─ C1
    │        ├─ D1
    │        │  └─ E1
    │        └─ D2
    │           └─ E2
    └─ Z1
       └─ Y1
          └─ X1
    

    Output (without root)

    A1
    └─ B1
       └─ C1
          ├─ D1
          │  └─ E1
          └─ D2
             └─ E2
    Z1
    └─ Y1
       └─ X1
    

    Undoable Move to Trash

    Two commands to move items to trash and to undo removals.

    Wayland Support

    Adds support for some features under Wayland compositors in KDE, Sway, Hyprland and possibly others.

    Command "Paste Items when Activated" pastes items when activated (on double-click or Enter key) depending on application configuration (History configuration tab).

    Paste behaviour is implemented with Shift+Insert shortcut. It works in most applications by default, but you may need to enable it for some (for example, for terminal emulators). Exact configuration changes vary by application. For example, for alacritty you should modify your alacritty.yml with next line:

      - { key: Insert, mods: Shift, action: Paste }
    

    Getting window title is currently implemented only for KDE, Sway and Hyprland.

    Requirements:

    Write Clipboard to File

    Stores clipboard continuously to a "clipboard.txt" (in home directory).