Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
This may well be wishful thinking, but it seems like it would be a very useful feature... Just wondering if it exists. Google has not been helpful.
What I'd like to be able to do is pipe output in the shell (hopefully bash) to X's PRIMARY selection, so that I can just middle click to paste it. Obviously it's really not hard to just select it in the terminal and paste, but I'm always on the lookout for better ways to do things.
I realise that bash has no real connection to X, and it's a little irrational to expect the two to interact in this way, is there another way of setting up the same effect? Is the PRIMARY selection accessible at all?
Interesting question. This confirms the volatile PRIMARY buffer is strictly a mouse-driven left-select, middle-paste thing and there is no access to it otherwise. ( While looking around I came across this which patches Xterm to use both CLIPBOARD and PRIMARY to overcome buffer volatility problems. Doesn't help your case though but it may be nice to know. ) As far as I can see it is not possible. A real kludge would be to write whatever you want to copy to a temp file, have an app in X notice the write, open the file, run a macro that yanks contents to CLIPBOARD. (And maybe use an app that manages multiple clippings (Freshmeat/SourceForge) to provide paste buffers.) That's nasty...
Is this a violation of "everything is a file", I wonder? I guess that idea is incompatible with how applications interface with selections in X. One of the links described it as drag-and-drop that allows a break between dragging and dropping, which makes sense. I can't think of any less nasty kludges, so I'll just carry on selecting and pasting. Like I said, it's hardly giving me RSI as it is.
A complication is to consider what happens when ssh-ed into another machine. You could have a special string that got caught by ssh maybe - winkey-c-( could mean start capturing from the remote host, then winkey-c-) ends the capture.
But aside from the ssh complication I think your "everything is a file therefore piping to the clipboard should be possible" is entirely reasonable.
Myself, I am too used to the Sun copy and paste buttons. The selection _stays_ on the clipboard no matter what else I've clicked in the meantime. I wouldn't mind utilising the useless windows key on this machine to emulate sun's copy and paste functions.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.