Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hluk/b1f69df944335f41242b to your computer and use it in GitHub Desktop.
Save hluk/b1f69df944335f41242b to your computer and use it in GitHub Desktop.
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
Copy link
Author

hluk commented Mar 24, 2017

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