Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
CopyQ - Synchronize Clipboard with Other Sessions
[Command]
Automatic=true
Command="
copyq:
// Select session to send data to.
var sessions = [
\"my_session_2\",
\"my_session_3\",
\"my_session_4\",
]
function passInput(session_name, command) {
execute(
\"copyq\", \"-s\", session_name,
command, \"application/x-copyq-item\", \"-\",
null, input())
}
function syncNewItem(session_name) {
passInput(session_name, \"write\")
}
function syncClipboard(session_name) {
passInput(session_name, \"clipboard\")
}
for (var i in sessions) {
// Set clipboard in each session.
//syncClipboard(sessions[i])
// Add new item in each session.
syncNewItem(sessions[i])
}"
Icon=\xf065
Input=text/plain
Name=Synchronize Clipboard with Other Sessions
@hluk

This comment has been minimized.

Copy link
Owner Author

commented Mar 24, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.