1)
% xclip -i -sel clip
This just blocks (makes sense)
2)
% printf | xclip -i -sel clip
This returns immediately (makes sense)
3)
% xclip -i -sel clip -verbose
Connected to X server.
Using selection: XA_CLIPBOARD
Using UTF8_STRING.
Blocks here
4)
% printf | xclip -i -sel clip -verbose
Connected to X server.
Using selection: XA_CLIPBOARD
Using UTF8_STRING.
Waiting for selection requests, Control-C to quit
Waiting for selection request number 1
Now I can go to another application, copy text to the clipboard
and xclip will exit as soon as I do the copying. This is very
useful, because it provides an event driven hook for changes to
the X clipboard.
5) printf | xclip -i -sel clip -quiet
Waiting for selection requests, Control-C to quit
Waiting for selection request number 1
Behaves the same as 4.
Why is the printf necessary? Why doesn't 3) behave like 4)?
Why is one of -quiet or -verbose necessary? Why doesn't 2) behave like 5)?
% xclip -version
xclip version 0.12
Copyright (C) 2001-2008 Kim Saunders et al.
Distributed under the terms of the GNU GPL
% uname -rs
FreeBSD 10.2-STABLE
The inconsistencies are likely something I'm misunderstanding. Thanks for xclip. It's a nice tool.
I didn't reallize that 4) blocks other applications from accessing the clipboard. So, it's not useful for the event driven hook I described above.