Last active
April 29, 2025 05:25
-
-
Save hmijail/78b42f9becc52e137323ef024cd2c910 to your computer and use it in GitHub Desktop.
A CopyQ command to implement a "Clipboard Revolver" (or LIFO, or Stack)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Probably can be fixed in a similar way that the FIFO counterpart:
https://gist.github.com/hmijail/5676ce439edbd3c1c5a0e46e04c5293a#gistcomment-3965258