Code Monkey home page Code Monkey logo

copyq's Introduction

CopyQ

Documentation Status Translation Status Linux Build Status macOS Build Status Windows Build Status Coverage Status

CopyQ is an advanced clipboard manager with powerful editing and scripting features.

Overview

  • CopyQ monitors the system clipboard and saves its content in customized tabs.
  • Saved clipboard entries can later be copied and pasted directly into any application.

Features

  • Support for Linux, Windows, and OS X 10.15+
  • Store text, HTML, images, and any other custom formats
  • Quickly browse and filter items in clipboard history
  • Sort, create, edit, remove, copy/paste, drag'n'drop items in tabs
  • Add notes and tags to items
  • System-wide keyboard shortcuts with customizable commands
  • Paste items with keyboard shortcuts, from tray, or from main window
  • Fully customizable appearance
  • Advanced command-line interface and scripting
  • Ignore clipboard copied from specified windows or containing specified text
  • Support for simple Vim-like editor with keyboard shortcuts
  • Many more features

Install

Packaging status

To install CopyQ, use the binary package or the installer provided for your operating system.

For unlisted operating systems, please follow the instructions in Build from Source Code.

Windows

Chocolatey package

On Windows you can use any of the following options to install CopyQ:

Using Scoop:

scoop install copyq

Using Chocolatey:

choco install copyq

OS X

Homebrew package

On OS X you can use Homebrew to install CopyQ:

brew install --cask copyq

Debian 10+, Ubuntu 18.04+, and their derivatives

Install copyq and copyq-plugins packages.

Ubuntu PPA

Install and keep CopyQ always up to date by running the following commands from the terminal (the package from PPA contains all plugins and documentation):

sudo add-apt-repository ppa:hluk/copyq
sudo apt update
sudo apt install copyq

Fedora

Install copyq package.

Arch Linux

Install copyq package.

Other Linux Distributions

Install Flatpak and com.github.hluk.copyq from Flathub.

flatpak install flathub com.github.hluk.copyq

Start CopyQ from the menu or with the following command:

flatpak run com.github.hluk.copyq

Using the App

To start CopyQ, double-click the program icon or run copyq.

The list with the clipboard history is accessible by clicking on the system tray icon or by running copyq toggle.

Copying text or image to the clipboard will create a new item in the list.

Selected items can be:

  • edited (F2)
  • removed (Delete)
  • sorted (Ctrl+Shift+S, Ctrl+Shift+R)
  • repositioned (with mouse or Ctrl+Up/Down)
  • copied back to the clipboard (Ctrl+C)
  • pasted to the previously active window (Enter)

All items will be restored when CopyQ is next started.

To exit CopyQ, select Exit from the tray menu or press Ctrl-Q in the CopyQ window.

Read more:

Adding Functionality

To create custom actions that can be executed from the menu, with keyboard shortcuts, or when the clipboard changes:

  • go to the Command dialog (F6 shortcut)
  • click the Add button, then select a predefined command, or create a new one
  • optionally change the command details (shortcut, name)
  • click OK to save the command

One of the very useful predefined commands is "Show/hide main window".

Read more:

Command Line

CopyQ has a powerful command line and scripting interface.

Note: The main application must be running to be able to issue commands using the command line.

Print help for some useful command line arguments:

copyq --help
copyq --help add

Insert some text in the history:

copyq add -- 'first item' 'second item' 'third item'

Omitting the double-dash (--) in the command above would mean that slashes (\) in arguments will be treated as special characters. For example, \n will be treated as the new line character, \t as tab, \\ as slash, \x as x, etc.

Create a single item containing two lines:

copyq add 'first line\nsecond line'

Print the content of the first three items:

copyq read 0 1 2
copyq separator "," read 0 1 2

Show the current clipboard content:

copyq clipboard
copyq clipboard text/html
copyq clipboard \?    # lists formats in clipboard

Copy text to the clipboard:

copyq copy "Some Text"

Load file content into the clipboard:

copyq copy - < file.txt
copyq copy text/html < index.html
copyq copy image/jpeg - < image.jpg

Create image items:

copyq write image/gif - < image.gif
copyq write image/svg - < image.svg

Read more:

Build from Source Code

To build CopyQ from source code, first install the required dependencies:

Install Dependencies

Ubuntu

sudo apt install \
  cmake \
  extra-cmake-modules \
  git \
  libqt5svg5 \
  libqt5svg5-dev \
  libqt5waylandclient5-dev \
  libqt5x11extras5-dev \
  libwayland-dev \
  libxfixes-dev \
  libxtst-dev \
  qtbase5-private-dev \
  qtdeclarative5-dev \
  qttools5-dev \
  qttools5-dev-tools \
  qtwayland5 \
  qtwayland5-dev-tools

RHEL / CentOS / Oracle Linux

sudo yum install \
  cmake \
  extra-cmake-modules \
  gcc-c++ \
  git \
  libXfixes-devel \
  libXtst-devel \
  qt5-qtbase-devel \
  qt5-qtdeclarative-devel \
  qt5-qtsvg-devel \
  qt5-qttools-devel \
  qt5-qtwayland-devel \
  qt5-qtx11extras-devel \
  wayland-devel \
  kf5-knotifications-devel

Build CopyQ

Change install prefix if needed:

git clone https://github.com/hluk/CopyQ.git
cd CopyQ
cmake .
make

You can now run the built app.

./copyq

Contributions

You can help translate CopyQ (click the banner below) or help fix issues and implement new features.

Translations

Read more:

copyq's People

Contributors

adem4ik avatar akcansoft avatar albanobattistella avatar avma avatar bovirus avatar comradekingu avatar dependabot[bot] avatar dglent avatar floss-dev avatar haaninjo avatar hluk avatar igorruckert avatar jsmakaayb avatar kosivantsov avatar m4r71n avatar mic92 avatar milotype avatar nijel avatar orschiro avatar philhosoft avatar pmraps avatar prolinuxua avatar rezaalmanda avatar rygwdn avatar sr093906 avatar sschuberth avatar vistaus avatar weblate avatar wtuemura avatar x2357 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

copyq's Issues

copied files uri error

copied files uri can not be disabled. even if 'data items' option in history tab is disabled, they appear in the main menu.

Make option to show only list

Make an user option "Clean Mode" to show only the list and hide main menu, tab bar and scroll bar. Pressing Alt key shows the hidden elements, releasing it hides the elements.

It should be possible to use Alt key for key hints to enter sub-menu in main menu and in tabs. Also Alt+left/right should focus next/previous tab.

Context menu, even in empty list, should allow user to toggle the "Clean Mode".

encoding issue

when copy Chinese character, copyQ could not correctly show it.

copyQ1

Support for Wayland

Basically Wayland is the new X11 and Weston is its window manager.

Since Qt 5 supports Wayland it should be possible to implement some basic functionality for it src/platform/wayland and test it on Weston.

Priority list:

  • Fix restoring window position on multiple screens
  • Implement global shortcuts

Update 2021-04-11:

Re-create tray menu properly

Methods in QMenu (e.g. clear(), removeAction()) can remove separators in TrayMenu. So separator members needs QPointer and needs to be recreated if needed after they're destroyed.

Do not delete TrayMenu object in MainWindow::createMenu(), just call QMenu::clear(). Create TrayMenu, set it as context menu for tray and connect signals in MainWindow contructor.

copyq-1.7.1 breaks plasma in kde-4.10.0

Step to reproduce:

1 Click on kde menu
2 Type copyq in search box
3 Click on CopyQ icon
4 plasma freeze

Nepomuk and akonadi are activated. Launching copyq from terminal and from menu tree is ok, maybe a krunner problem?
Regards.

Feature request: Option to empty/expire (or encrypt) tab history.

The clipboard history can contain commonly used sensitive info, which is convenient but one may not want it persisted across sessions. I created the following command to empty the clipboard history on demand:

copyq eval -- "tab('&clipboard'); for(i=size(); i>0; --i) remove(i-1);"

It would help to have the option of running this command automatically when Copyq quits, which usually happens when I logout. It would also be useful to have the history of a tab cleared at configurable time intervals while Copyq is running.

An alternate/advanced approach would be to optionally encrypt a tab and require a passphrase to access it, with a configurable no-activity timeout+reprompt.

Option to Disable Clipboard Monitoring

Add new option to disable clipboard monitoring, i.e. no new clipboard content is added to clipboard history.

If monitoring is disabled, application and tray icons should change, e.g. grey color for scissor icon (new icons must be installed so that desktop theme can change the appearance).

After turning monitoring on again:

  • restore application and tray icons,
  • current clipboard content should be ignored.

Add scripting capability and global shortcut to toggle the monitoring.

Where are dependencies documented?

I cannot find any hint on what dependencies are needed. Sorry if I'm missing the obvious. In the AUR we had a hint about qtwebkit being a dependency. How can I make sure?

Automatically pasting when selecting from menu should be an option

Prior to my most recent git fetch, selecting an item from the menu would not automatically paste (emulate Shift+Insert since I'm on X11). Now it does. This breaks my workflow. Any chance we can make this an application setting instead, so that folks who liked the old behaviour can still have it?

Don't Process Incomplete X11 Selection

GVim under X11 starts setting primary selection buffer after entering visual mode ('v' key pressed). After text cursor is moved the X11 selection is updated immediately. This clutters clipboard history in CopyQ with incomplete text of the selection.

Possible Solution

Update the first item in history if its text is prefix or suffix of the current X11 selection from the same window (i.e. "application/x-copyq-owner-window-title" is same).

sequential paste/"pop mode" (feature request)

Suppose I want to copy a name, say Bob Smith, and an email, say
bobsmith@... from a document, into
a form that has three fields:
(1) First Name, (1) Last Name, and (3) email
I would like to be able to copy Bob, then copy Smith, then copy
bobsmith@... and then go to the form and paste one after
the other. It would be nice if after I pasted one, it was deleted from
CopyQ so I don't even have to go to the history and select the next
one, it's already loaded and ready to go. I think a fitting name could
be "pop mode" where after you paste
something, that entry just pop's off.

Could this be done with native paste directly? If CopyQ does not own
the paste, then it could still be implemented by using a different
key-binding. That is to say, you could allow the user to pick a
key-binding (default to ctrl+alt+v?) that, when called, would use the
system's paste function and then pop off the element in CopyQ.

Make Commands easier to understand and use

TODO: This need to be a lot simpler!

Command can be identified by name and icon (from item menu).

  1. Match item by (none or any combination):
    • Content (text),
    • Window (title),
    • Format (MIME).
  2. Possible actions on matching items (any combination):
    • Ignore,
    • tab for copying,
    • command.
  3. Set command parameters (if command is set).
  4. Specify:
    • Perform automatically?
    • Show in menu?
    • Hide main window after activated from menu?
    • Set shortcut.

Don't Reorder Item List on Item Activation

On enter key or double-click mark put the item content to clipboard (current behavior) but don't move the item to the first position in list.

Also keep the item selected after window is closed and create shortcut to move next/previous item to clipboard in the same manner -- i.e. pressing ctrl-shift-n will select next item and move it to clipboard ( ctrl-shift-p to select previous). Additionally create scripting capability and global shortcuts for this.

After a new item is added to history, select the item -- but only if list is not focused or inline-editing is not active in the list.

Make this new behavior optional.

Improved Plugins

Interface for coding new plugins should be easy to use and as dynamic as possible.

Solution

  • Plugin should be able to add an QAction to context menu of its item.
  • Add bool ItemLoaderInterface::matches(const QModelIndex &index, const QRegExp &re) to search for items.
  • Add Doxygen comment for each method for ItemLoaderInterface and ItemWidget.

Copy with <Ctrl+C> after Mouse Select

If "selection to clipboard" is checked and "selection to history" is not checked the new content from mouse selection (without Ctrl+C) is copied to clipboard but it's not added to CopyQ history. This works correctly.

If you press <Ctrl+C> on the selection it should be added to the history -- but it's not.

dismiss tray menu using background click/exc when invoked from keyboard

steps to reproduce
setup keyboard shortcut for tray menu
invoke tray menu via keyboard

expected behavior:
dismiss by changing focus, hitting esc key or (most often) clickking away from the popup

actual behavior:
have to select a clip to dismiss.

n.b. dismiss works properly when tray menu is invoked by rt-click on sys tray icon

Middle click on tray icon

In README i see:
To exit the application middle-click on the tray icon
But in code i see another version:

    if ( reason == QSystemTrayIcon::MiddleClick ) {
        showMenu();
    } else if ( reason == QSystemTrayIcon::Trigger || reason == QSystemTrayIcon::DoubleClick ) {
        toggleVisible();
    }

Who to belive =)

More Informative Window Title

Main window title should contain preview of current clipboard content.

Window Title Format

  • Short text: "first line without leading spaces ..." - CopyQ
  • Image: <image> - CopyQ
  • Other: <data> - CopyQ

Note: <image> and <data> should be translatable.

Automatic tray paste

usleep() event is in micro seconds! So usleep(500) used when pasting text from tray on X11 is too small. On some systems even big period is not enough.

Solution

Use QApplication::processEvents() before pasting to window and use usleep() with argument 200000 (500 ms seems too big). Also change the interval for Windows platform with Sleep(250).

Formatted text is copied even after switch to text/plain

When I press ctrl-left on an item to render it as text/plain and press enter, I would expect CopyQ to copy the item as text/plain. Instead it copies the item still formatted.
I know I can instruct CopyQ to strore only text/plain, but I want to retain the formatting in CopyQ otherwise.

Misbehaving Appearance settings

Color dialogs are often immediately reopened after closed.

Button "Reset theme" doesn't do anything.

These issues are reproducible on Ubuntu, Qt 4.8.3, and Windows, Qt 4.8.4.

Command Option to Transform Selected Items

Command option transform will change data of selected items or (if automatic) change clipboard data and pass to next command in queue.

The new option is available only if "Command" and "Output" fields are filled in.

Make "Synchronize" options easier to understand

These (very important) options should be simple to understand for any user. Default values should make sense (e.g. don't store the X11 mouse selections by default).

Rename:

  • whole option group "Synchronize" to "Synchronize and Store",
  • "clipboard to history" to "Save Clipboard",
  • "selection to history" to "Save Mouse Selections",
  • "clipboard to selection" to ???
  • "selection to clipboard" to ???

More general Import/Export

Replace "Import/Export Tab" in File menu with more general "Import ...", "Export ...".

Export command will open simple dialog containing list with all tabs -- with only the current one selected by default -- and check boxes with whatever else to export.

Exported/imported could be none or multiple tabs, options, theme and commands. Accepting dialog should be disabled if nothing is selected to be exported/imported.

Import should provide the import dialog only if imported file contains anything else than single tab. This dialog should allow user to choose elements to import from imported file.

If commands are imported, existing commands should not be overwritten (the same goes for tabs).

Edit: Import dialog should be open even if imported file contains only single tab -- for user to review changes.

Move scripting capability out of main thread

So as not to make GUI slower while running commands from multiple clients, serve each client (process commands, run script) in different thread (non-GUI thread).

Create new class which performs commands from client and sends back responses. Objects of this class will run in different thread communicating with other objects only using signals/slots.

Paste to current window

I can't paste from main window to current window anymore. I'm sure right option is selected in preferences. It worked for me in CopyQ 1.8.0. It fails in 1.8.1. Tested on ArchLinux and Windows 7.

icon out of place on Ubuntu 13.04

On a fresh install of Ubuntu 13.04, 64-bit of commit 5a54f05, the scissors icon is out of place (see upper-left of screenshot). This is my first install of CopyQ on 13.04. On 12.04 I didn't see this behavior. The icon seems to respond normally (left- and right- clicks). Let me know if there is any log I can send or anything else I can do to help.
screenshot from 2013-06-01 06 28 47

Main window opacity

It would be nice if you could set main windows opacity value. So main window wouldn't hide the window where you were typing.

Windows installer

I think it would be nice if CopyQ would have a Windows installer. I know CopyQ is portable (great) but newbies users feel more confortable with a Windows installer. The installer unpack files, copy them to user application folder and makes Windows launch CopyQ at startup. Windows users could choice: portable (.zip) or installer version (.exe or .msi).
Windows installer will make more people use CopyQ (and that will be great).

Note: I don't know if you should use NSIS, InnoSetup, Wix, IzPack or someone else installation software.

Ignore clipboard content from a window more safely

Clipboard monitor sets focused window title text in new clipboard item. This window is treated as clipboard owner -- it's not very reliable since user can focus different window before clipboard content is propagated to monitor.

Monitor should send clipboard item with window title set only "immediately" after clipboard is changed.

If some command "ignores" a content with given window title, all items without window title (this MIME type missing) should be also ignored.

Faster Application Start

Saved items for all tabs are loaded at application start. With large amount items in tabs this can take a long time.

Solution

  • Load only the first tab at start.
  • Load tabs only after their data are requested.
  • Load tabs in a different thread.
  • Unload items after tab is hidden to save memory (after and interval ~5 minutes).
  • Save tab only after it is fully loaded (file format for saved tab is not suited for lazy loading and unloading items).

tag 1.5.0

Could you create a git tag for 1.5.0?
I'd like to update AUR package :).

QtWebKit as opt-in dependency?

In connection with #5:
Is there any way to link to QtWebKit at runtime?
I'd like to make it an optional dependency, but telling the user who just compiled the app to install something and compile it again doesn't seem like a good solution.

BTW: Just checked and it seems that CopyQ (1.6.0) doesn't compile at all without QtWebKit:

In file included from /tmp/yaourt-tmp-root/aur-copyq/src/CopyQ-1.6.0/src/itemweb.cpp:22:0:
/tmp/yaourt-tmp-root/aur-copyq/src/CopyQ-1.6.0/src/include/itemweb.h:25:29: fatal error: QtWebKit/QWebView: No such file or directory
compilation terminated.
make[2]: *** [CMakeFiles/copyq.dir/src/itemweb.cpp.o] Error 1
make[1]: *** [CMakeFiles/copyq.dir/all] Error 2
make: *** [all] Error 2

Preventing auto-copy

Is there a way to prevent auto-copying of selected content?

I'm having an issue with some things - like google search - where I copy some content in one window (select & ctrl C) - goto an existing browser window with a google search. I select the current google search to delete it - and when I paste - I get back the search I just deleted.

My workflow is more:
select something - then CTRL C or CTRL X
goto another window - select some content I want to replace
paste to overwrite the content

I'm running Mint 14 with Cinnamon

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.