Copyq: Duplicate commands triggered from single Clipboard copy

Created on 21 May 2019  路  3Comments  路  Source: hluk/CopyQ

I really struggled writing a command to send a copied link from Chromium to Firefox, because the links were almost always opened twice.

To Reproduce

  • Create an "Automatic" command
  • Matching Content "^http"
  • Command: copyq: open(str(data('text/plain'))

Expected behavior
One browser tab is opened when some http url is copied.
Instead I get 2 browser tabs!

Version, OS and Environment

  • Application Version v3.8.0
  • OS Linux Mint 19
  • Desktop environment: Cinnamon

Additional context
The following "Command" script avoids and illustrates the issue:

copyq:
var incoming = str(data('text/plain'));
var prev = str(read(0));
if (incoming == prev)
  popup("REPEATED!", incoming+'\n==\n'+prev);
else
  open(incoming);
bug

Most helpful comment

Automatic commands are run also when X11 mouse selection buffer changes. You can avoid this by checking isClipboard().

copyq:
if (isClipboard())
    open(data(mimeText))

All 3 comments

Automatic commands are run also when X11 mouse selection buffer changes. You can avoid this by checking isClipboard().

copyq:
if (isClipboard())
    open(data(mimeText))

You can avoid this by checking isClipboard().

Thanks, that works.
So is this a bug or a feature?

So is this a bug or a feature?

Feature. It's useful to run some commands when selection changes.

Was this page helpful?
0 / 5 - 0 ratings