From 8381f31930c7d166bb58d43c776a33578987cc71 Mon Sep 17 00:00:00 2001 From: Tudor Brindus Date: Sun, 15 Dec 2019 20:19:05 -0500 Subject: [PATCH] Sync clipboard contents on startup --- xclipsync | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/xclipsync b/xclipsync index c6de28d..1ef2059 100755 --- a/xclipsync +++ b/xclipsync @@ -10,6 +10,13 @@ fi MAIN=":0" ME="$DISPLAY" + +# Sync immediately on startup, otherwise the first time we paste we will paste +# the error string "Error: target STRING not available", and trash the original +# clipboard contents. +xclip -display "$MAIN" -selection CLIPBOARD -o | + xclip -display "$ME" -selection CLIPBOARD -i + while :; do # This seems almost too easy, but it's exactly what we want. # Pick two displays, A and B. We always want to be proxying the