Add new command to open the CopyQ window or menu with a global shortcut:
- Open "Command" dialog (
F6
shortcut). - Click "Add" button in the dialog.
- Select "Show/hide main window" or "Show the tray menu" from the list and click "OK" button.
- Click the button next to "Global Shortcut" label and set the shortcut.
- Click "OK" button to save the changes.
For more information about commands see :ref:`writing-commands`.
- Open "Preferences" (
Ctrl+P
shortcut). - Go to "History" tab.
- Enable "Paste to current window" option.
Next time you open the CopyQ main window and activate an item, it should be pasted.
To paste clipboard as plain text:
- Open "Command" dialog (
F6
shortcut). - Click "Add" button in the dialog.
- Select "Paste clipboard as plain text" from the list and click "OK" button.
- Click the button next to "Global Shortcut" label and set the shortcut.
- Click "OK" button to save the changes.
To paste selected items as plain text (from CopyQ window) follow the steps above but add "Paste as Plain Text" command instead and change "Shortcut".
To disallow storing HTML and rich text:
- Open "Preferences" (
Ctrl+P
shortcut). - Go to "Items" tab.
- Disable "Web" item in the list.
- Select "Text" item.
- Disable "Save and display HTML and rich text".
Similarly, you can also disable "Images" in the list to avoid storing and rendering images.
Existing items won't be affected but any data formats can be removed:
- Select an item.
- Press
F4
shortcut ("Item - Show Content..." in menu). - Select format from list.
- Press
Delete
key.
To temporarily disable storing the clipboard in the CopyQ item list,
select menu item "File - Disable Clipboard Storing" (Ctrl+Shift+X
shortcut).
To re-enable the functionality select "File - Enable Clipboard Storing" (same shortcut).
To permanently disable storing the clipboard in CopyQ:
- Open "Preferences" (
Ctrl+P
shortcut). - Go to "History" tab.
- Clear "Tab for storing clipboard" field.
From menu select "File - Export" and choose which tabs to export and whether to export configuration and commands.
To restore the backup, select menu item "File - Import", select the exported file, and then choose what to import back.
Note
Importing tabs and commands won't override existing tabs, and will create new ones.
To enable displaying the notifications:
- Open "Preferences" (
Ctrl+P
shortcut). - Go to "Notifications" tab.
- Set non-zero value for "Interval in seconds to display notifications".
- Set non-zero value for "Number of lines for clipboard notification".
- Click "OK" button.
To enable displaying the notifications, set either of the options mentioned above to zero.
You can stumble upon code that looks like this.
[Command]
Name=Show/hide main window
Command=copyq: toggle()
Icon=\xf022
GlobalShortcut=ctrl+shift+1
This code represents a command that can used in CopyQ (specifically it opens main window on Ctrl+Shift+1). To use the command in CopyQ:
- Copy the code above.
- Open "Command" dialog (
F6
shortcut). - Click "Paste Commands" button at the bottom of the dialog.
- Click OK button.
(Now you should be able to open main window with Ctrl+Shift+1.)
To share your commands, you can select the commands from command list in "Command" dialog and press "Copy Selected" button (or just hit Ctrl+C).
Add and modify automatic command to ignore text copied from the window:
- Open "Command" dialog (
F6
shortcut). - Click "Add" button in the dialog.
- Select "Ignore Password window" from the list and click "OK" Button.
- Select "Show Advanced"
- Change "Window" text box to match the title (or part of it) of the
Window to ignore (e.g.
KeePass
). But for KeePassXC (and possible other apps), it is better to set "Format" tox-kde-passwordManagerHint
instead. - Click "OK" button to save the changes.
Note
This new command should be at the top of the command list because automatic commands are executed in the order they appear in the list, and we don't want to process sensitive data in any way.
In some cases, e.g. the password manager is an extension of a web browser or a
password is copied from a menu instead of a window, the command above won't
work. You can try setting the "Window" text box to ^$
, which usually matches
popup menus.
For a more reliable way, use a command to blacklist texts (it stores just a salted hash, the text itself is not stored anywhere).
Set environment variable COPYQ_LOG_LEVEL
to DEBUG
for verbose logging
and set COPYQ_LOG_FILE
to a file path for the log.
You can copy current log file path to clipboard from Action dialog (F5 shortcut)
by entering command copyq 'copy(info("log"))'
. Alternatively, press F12
to directly access the log.
If you cannot access GUI, you can restart CopyQ from terminal and log to a separate file. On Linux and macOS:
copyq exit
export COPYQ_LOG_LEVEL='DEBUG'
export COPYQ_LOG_FILE="$HOME/copyq.log"
echo "Logs will be written to $COPYQ_LOG_FILE"
copyq
On Windows (in PowerShell):
& 'C:\Program Files (X86)\CopyQ\copyq.exe' exit
$env:COPYQ_LOG_LEVEL = 'DEBUG'
$env:COPYQ_LOG_FILE = [Environment]::GetFolderPath("MyDocuments") + '\copyq.log'
echo "Logs will be written to $env:COPYQ_LOG_FILE"
& 'C:\Program Files (X86)\CopyQ\copyq.exe'
- Reverse order of selected items with
Ctrl+Shift+R
and copy them. - Alternatively, select items in reverse order and then copy.
See #165.
Return
key copies the whole item (with all formats) to the clipboard
and -- if the "Paste to current window" option is enabled -- it sends
Shift+Insert
to previous window. So the target application decides
what format to paste on Shift+Insert
.
If you select more items and press Return
, just the concatenated
text of selected items is put into the clipboard. Though it could do more
in future, like join HTML, images or other formats.
See #165.
Pasting from CopyQ works only on Windows, macOS and X11 on Linux.
Specifically, this feature is not supported on Wayland, but you can use the workaround: :ref:`known-issue-wayland`
First, check if you have the appropriate options enabled:
- For pasting from main window, enable "Paste to current window" in "History" configuration tab.
- For pasting from tray menu, enable "Paste activated item to current window" in "Tray" configuration tab.
If the pasting still doesn't work, check if Shift+Insert
shortcut pastes to
the target window. That's the shortcut CopyQ uses by default. To change this to
Ctrl+V
see #633.
If pasting still doesn't work, it could be caused by either of these problems:
- CopyQ fails to focus the target window correctly.
- The format copied to the clipboard is not supported by the target application.
Use Alt+I
to open the item menu or use the Menu
key on your keyboard
to open the context menu for selected items.
The menu bar can be hidden by modifying the style sheet of the current theme.
- Open "Preferences" (
Ctrl+P
shortcut). - Go to "Appearance" tab.
- Enable checkbox "Set colors for tabs, tool bar and menus".
- Click "Edit Theme" button.
- Find
menu_bar_css
option and addheight: 0
:
menu_bar_css="
;height: 0
;background: ${bg}
;color: ${fg}"
By default, only the text is stored in item list when you copy or cut files from a file manager. Other data is usually needed to be able to copy/paste files from CopyQ.
You have to add additional data formats (MIME) using an automatic command
(similar to one below). The commonly used format in many file managers is
text/uri-list
. Other special formats include
x-special/gnome-copied-files
for Nautilus and
application/x-kde-cutselection
for Dolphin. These formats are used to
specify type of action (copy or cut).
[Command]
Command="
var originalFunction = global.clipboardFormatsToSave
global.clipboardFormatsToSave = function() {
return originalFunction().concat([
mimeUriList,
'x-special/gnome-copied-files',
'application/x-kde-cutselection',
])
}"
Icon=\xf0c1
IsScript=true
Name=Store File Manager Metadata
You can check application/x-copyq-clipboard-mode
format in automatic commands.
E.g. if you set input format of a command it will be only executed on Linux mouse selection change:
[Command]
Automatic=true
Command="
copyq:
popup(input())"
Input=application/x-copyq-clipboard-mode
Name=Executed only on X11 selection change
Otherwise you can check it in command:
[Command]
Automatic=true
Command="
copyq:
if (str(data(mimeClipboardMode)) == 'selection')
popup('selection changed')
else
popup('clipboard changed')"
Name=Show clipboard/selection change
See: :ref:`known-issue-macos-paste-after-install`
CopyQ creates a temporary file with content of the edited item and passes it as argument to the custom editor command. If the file changes, the item is also modified.
Usual issues are:
- External editor opens an empty file.
- External editor warns that the file is missing.
- Saving the file doesn't have any effect on the origin item.
This happens if the command to launch the editor exits, but the editor application itself is still running. Since the command exited, CopyQ assumes that the editor itself is no longer running, and stops monitoring the changes in the temporary file (and removes the file).
Here is the correct command to use for some editors:
emacsclientw.exe --alternate-editor="" %1 gvim --nofork %1 sublime_text --wait %1 code --wait %1 open -t -W -n %1
You can find configuration and saved items in:
- Windows folder
%APPDATA%\copyq
for installed version of CopyQ. - Windows sub-folder
config
in unzipped portable version of CopyQ. - Linux directory
~/.config/copyq
. - In a directory specific to a given CopyQ instance - see :ref:`sessions`.
Run copyq info config
to get absolute path to the configuration file
(parent directory contains saved items).
Check access rights to configuration directory and files.
Global/system shortcuts (or specific key combinations) don't work in some desktop environments (e.g. Wayland on Linux).
As a workaround, you can try to assign the shortcuts in your system settings.
To get the command to launch for a shortcut:
- Open Command dialog (F6 from main window).
- Click on the command with the global shortcut in the left panel.
- Enable "Show Advanced" checkbox.
- Copy the content of "Command" text field.
Note
If the command looks like this:
copyq: toggle()
the actual command to use is:
copyq -e "toggle()"
The main window remains open if it cannot minimize to task bar and tray icon is not available. This is a safety feature to allow users to see that the application is running and make any initial setup when the app is started for the first time.
To force hiding main window:
- Open "Preferences" (
Ctrl+P
shortcut). - Go to "Layout" tab.
- Enable "Hide main window" option.
Alternatively, run the following command:
copyq config hide_main_window true
Encryption plugin uses gpg2
to decrypt tabs and items. The password usually
needs to be entered only once every few minutes.
If the password prompt is showing up too often, either increase tab unloading
interval ("Unload tab after an interval" option in "History" tab in
Preferences), or change gpg
configuration (see #946).
If you're getting copyq: command not found
or similar error, it means that
the copyq
executable cannot be found by the shell or a language interpreter.
This usually happens if the executable's directory is not in the PATH
environmental variable.
If this happens when running from within the command, e.g.
bash:
text="SOME TEXT"
copyq copy "$text"
you can fix it by using COPYQ
environment variable instead.
bash:
text="SOME TEXT"
"$COPYQ" copy "$text"
When CopyQ crashes or doesn't behave as expected, try to look up a similar issue first and provide details in a comment for that issue.
If you cannot find any such an issue, report a new bug.
Try to provide the following details:
- CopyQ version
- operating system (desktop environment, window manager, etc.)
- steps to reproduce the issue
- application log (see :ref:`faq-share-commands`)
- stacktrace if available (e.g. on Linux
coredumpctl dump --reverse copyq
)