Skip to content

Instantly share code, notes, and snippets.

@hmijail
Created June 12, 2017 11:33
Show Gist options
  • Save hmijail/78b42f9becc52e137323ef024cd2c910 to your computer and use it in GitHub Desktop.
Save hmijail/78b42f9becc52e137323ef024cd2c910 to your computer and use it in GitHub Desktop.
A CopyQ command to implement a "Clipboard Revolver" (or LIFO, or Stack)
[Command]
Command="
copyq:
select(0)
paste()
remove(0)"
GlobalShortcut=meta+ctrl+v
Name=Clipboard LIFO
@hmijail
Copy link
Author

hmijail commented Jun 12, 2017

I don't know how many apps and hacks I have tried during the last decade to try to have this functionality - which CopyPaste Pro offered in the pre-OS X Mac OS, but somehow lost long ago. Nothing worked well enough or offered the exact functionality. Even heavy-weights like QuickSilver and LaunchBar and Alfred came short.

And turns out that the CopyQ project does it perfectly and easily... and of course even gives you the ability to make your own shade of it. Want a FIFO? Have a FIFO!

@reznir
Copy link

reznir commented Oct 31, 2017

It is not working it pastes two times the same and jumps over on item in clipboard

@dlsso
Copy link

dlsso commented Dec 23, 2019

Not working for me either, but seems to be a problem with the software, not this script.
I tried to implement by doing f6, add a global shortcut command (find script option) and then entering the script under command.
I can trigger the command, but paste() does not paste so it just ends up removing items from the clipboard.

@hmijail
Copy link
Author

hmijail commented Dec 23, 2019

Unfortunately I can only say that when I posted it, it worked... and then it stopped working. I don't remember if it was because of a CopyQ update or an OS update; the failure mode changed a couple of times and I never looked seriously into making it work again.

@waiting-for-dev
Copy link

Probably can be fixed in a similar way that the FIFO counterpart:

https://gist.github.com/hmijail/5676ce439edbd3c1c5a0e46e04c5293a#gistcomment-3965258

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