Skip to content

Instantly share code, notes, and snippets.

@hmijail
Last active April 29, 2025 05:25
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:
//works as of CopyQ v10.0.0
var c = count()
if (c==0) {
fail()
}
select(0)
try {
paste()
} catch (e) {
popup('Pasting Failed', e)
abort()
}
if (config('move') == 'true') {
remove(c-1)
} else {
remove(0)
}
popup('LIFO-pasted', str(c-1)+\" remaining\", 2000)
"
GlobalShortcut=meta+ctrl+v
IsGlobalShortcut=true
Name=HM Clipboard LIFO
@hmijail
Copy link
Author

hmijail commented Apr 29, 2025

I just updated it to a version that works with CopyQ v10.0.0.
Thank you @waiting-for-dev !

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