astrand / xclip

Command line interface to the X11 clipboard
GNU General Public License v2.0
1.04k stars 75 forks source link

Exchange PRIMARY and SECONDARY using target side-effects #95

Open hackerb9 opened 3 years ago

hackerb9 commented 3 years ago

ICCCM says it is possible to exchange PRIMARY and SECONDARY selections without copying to a third selection by using target side-effects. We should implement. The solution we offer right now is rather ugly:

$ xclip -sel s | xclip -sel b
$ xclip | xclip -sel s
$ xclip -sel b | xclip

It'd be better to have:

$ xclip -exchange