/copyq-scripting:bind-global-shortcutfrom copyq-scripting
Bind a system-wide keyboard shortcut to a CopyQ Custom Command — show menu, paste-as-plain-text, run a transformation on the current clipboard, etc. Covers both the in-CopyQ `GlobalShortcut` field and the alternative of binding the shortcut at the desktop-environment level (KDE / GNOME) to a `copyq` CLI invocation.
Ships in copyq-scripting. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
There are two viable approaches. Pick based on context:
| Approach | When to use |
|---|---|
CopyQ's built-in GlobalShortcut | Default. Lives with the command, portable across machines via command export. |
Desktop-environment shortcut → copyq <cli> | Wayland sessions where CopyQ's global shortcut grabber doesn't work, or when the action is a simple CLI call. |
On KDE Plasma 6 / Wayland (the user's setup), CopyQ's built-in global shortcuts can be unreliable because Wayland restricts global key grabbing. Default to the DE-level approach on Wayland unless verified working.
GlobalShortcutAdd GlobalShortcut to a Custom Command:
[Commands]
1\Name=Paste as plain text
1\GlobalShortcut=ctrl+alt+v
1\Command="
copyq:
var t = str(clipboard());
copy(mimeText, t);
paste();
"
size=1
Or set it in the GUI: Preferences → Commands → (select command) → Global Shortcut.
Verify it works after import:
copyq loadCommands "$(cat shortcut.ini)"
# Then press the keybind in any focused app.
Bind the shortcut at the DE level via kglobalaccel / System Settings, pointing at a copyq CLI call.
Command examples:
| Action | Command |
|---|---|
| Show CopyQ menu under cursor | copyq menu |
| Show main window | copyq toggle |
| Paste as plain text | copyq eval -- 'copy(str(clipboard())); paste();' |
| Cycle to previous clipboard item | copyq prev && copyq paste |
| Send selection to a "Snippets" tab | copyq eval -- 'tab("Snippets"); add(str(clipboard()));' |
# Create a desktop-action file that calls copyq
mkdir -p ~/.local/share/applications
cat > ~/.local/share/applications/copyq-paste-plain.desktop <<'EOF'
[Desktop Entry]
Type=Application
Name=CopyQ Paste Plain
Exec=copyq eval -- 'copy(str(clipboard())); paste();'
NoDisplay=true
EOF
Then bind a global shortcut to it via System Settings → Shortcuts → Add Application → pick the entry.
Settings → Keyboard → View and Customize Shortcuts → Custom Shortcuts → +. Set Command to the same copyq ... invocation.
Add to config:
bindsym $mod+v exec copyq menu
bindsym $mod+Shift+v exec copyq eval -- 'copy(str(clipboard())); paste();'
// Paste-as-plain-text
copy(str(clipboard())); paste();
// Strip URL tracking params from clipboard then paste
var t = str(clipboard()).replace(/([?&])(utm_[^=&]+|fbclid|gclid)=[^&]*/g, '$1').replace(/[?&]$/, '');
copy(t); paste();
// Insert a templated snippet
copy('Best regards,\nDaniel'); paste();
// Push current clipboard to a "Saved" tab without disturbing focus
tab('Saved'); add(str(clipboard()));
After binding, test by focusing a text editor and pressing the key. If nothing happens:
pgrep -a copyq).kglobalaccel5 --list on KDE).What SKILL.md sets; muted values are Claude Code's defaults
copyq-scripting@danielrosehill is listed by danielrosehill/claude-code-plugins — review the source before installing
npx claudepluginhub danielrosehill/claude-code-plugins --plugin copyq-scripting7 skills in this plugin
/clipboard-inspectRead the current clipboard, the X11 PRIMARY selection, or any item from CopyQ history — by row, by MIME type, or filtered by regex. Use when the user wants to inspect what's on the clipboard, dump history to a file, or pipe clipboard contents into another tool./copyq-cli-referenceAuthoritative reference for the CopyQ command-line interface and scripting language on Ubuntu Linux. Load this before authoring any other CopyQ skill output so generated commands and scripts are syntactically valid. Covers `copyq` subcommands (read, write, add, remove, tab, select, eval, edit), the embedded ECMAScript-flavoured scripting language, MIME-type handling, and item formats./