• Re: sync X11 primary selection and clipboard

    From Javier@21:1/5 to Ben Collver on Wed May 25 22:40:44 2022
    XPost: alt.os.linux.slackware

    Ben Collver <bencollver@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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)