X11 clipboard synchronization with blacklisted apps
If you are X11 user, you have two main selection types 1 (often called clipboards) to your disposal:
- PRIMARY: used when you select text with the mouse and use middle-mouse button to paste it
- CLIPBOARD: used for explicitly copy/paste commands, most typically ctrl+c/ctrl+v shortcuts
I’m sure that this is useful for some, but if you are anything like me, single clipboard would be sufficient
and easier to use.
Thankfully, this is easily achievable with autocutsel
2 which I start in my .xinitrc
:
|
|
With this daemons running, there is both way synchronization between clipboards. Anything selected with mouse can be pasted with ctrl+v, anything copied with ctrl+c can be pasted with middle mouse button.
That’s great but there is one catch! Some applications may automatically select text. In such case, you may unwillingly loose your last copied data. For me, this major annoyance was caused by KiCad, which automatically pre-selects footprint’s reference designator in its properties window. Anytime I wanted to paste new property, my selection was overridden.
This issue can be solved by applying this patch to autocutsel
:
|
|
The way it works is simple. Each new PRIMARY selection is filtered by its original owner name before it is further processed.
When owner happens to be equal kicad
it is just ignored.