Skip to content

Instantly share code, notes, and snippets.

@hmijail
Created June 12, 2017 11:37
Show Gist options
  • Save hmijail/5676ce439edbd3c1c5a0e46e04c5293a to your computer and use it in GitHub Desktop.
Save hmijail/5676ce439edbd3c1c5a0e46e04c5293a to your computer and use it in GitHub Desktop.
A CopyQ command to implement a Clipboard FIFO
[Command]
Command="
copyq:
maxrow = count()-1
select(maxrow)
paste()
remove(maxrow)"
GlobalShortcut=ctrl+shift+v
Name=HM Clipboard FIFO
@reznir
Copy link

reznir commented Oct 31, 2017

It is not working it deletes wrong item in clipboard.

@waiting-for-dev
Copy link

That's because of the value of the move setting (Preferences -> History -> Move item to the top). When true, the script needs a tweak. The reason is that the select function not only selects but can also move depending on that setting. You can have it like the following to work with both values:

[Command]
Command="
copyq: 
maxrow = count() - 1
select(maxrow)
paste()
if (config('move') == 'true') {
  remove(0)
} else {
  remove(maxrow)
}"
GlobalShortcut=ctrl+shift+v
Name=HM Clipboard FIFO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment