Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm wondering if there is a command line clipboard manipulation program for Linux like xsel or xclip that supports RTF formatted data? What I mean is, if I use xsel to put RTF data on the clipboard, when I paste I get ASCII RTF code—not formatted text. Xsel and xclip can only handle plain text.

On MacOS, the pbpaste and pbcopy commands will automatically set the content type of the clipboard to RTF if there is an RTF header in the data. I'm looking for a Linux program that will do just that.

I need to use it in scripts, so graphical clipboard managers will not work.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Correct me if I'm wrong, but I think that the application that you are pasting to support formatting. I have done some copy/paste handling in my day, and I had to format whatever data I get from the paste command.

As for the headers, what environment are you running, Gnome or KDE? AFAIK, the clipboard is not a feature of the kernel but of the environment you are running.

Here is a similar issue on StackOverflow:

http://stackoverflow.com/questions/4486376/does-the-gnome-clipboard-have-a-mime-type-associated-with-the-data

I don't know about any command-line utilities. Here are some things that I found:

share|improve this answer
    
I was trying to use the X selection system so that it wouldn't matter whether or not a particular widget set or window manager's libraries were installed. Thank you very much for the question-link by the way...it sort of answers the question that I had been wondering about. It seems that the ability to handle non-(plain)text formats in the clipboard is an extension provided by gnome/gtk or qt/kde. I'll just have to implement it in gtk and live with it. ;) –  Matthew Apr 4 '11 at 13:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.