Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: sync X11 primary selection and clipboard

307 views
Skip to first unread message

Javier

unread,
May 25, 2022, 11:40:50 PM5/25/22
to
Ben Collver <benco...@tilde.pink> wrote:
> I will keep an eye out for something that can work system-wide.

clipnotify looks very close to what you need.

https://github.com/cdown/clipnotify/blob/master/clipnotify.c

The only problem is that it notifies both changes in clipboard and
primary without telling which selection was actually changed.

Just comment this line in the source:

/* XFixesSelectSelectionInput(disp, root, clip, XFixesSetSelectionOwnerNotifyMask); */

and call it primarynotify.c

Compile it and run in the shell

while primarynotify; do
xclip -o -selection primary | xclip -i -selection clipboard
done

NOTE: I have not tested this.
0 new messages