In Windows I used command-line clipboard copy-and-paste utilities...
pclip.exe
andgclip.exe
These were UnixUtils ports for Windows (but they only handled plain text). There were a couple of other native Windows utilities which could write/extract any format.
I've looked for something similar in Synaptic Package Manager, but I can't find anything.
Is there something there, that I've missed? ... or maybe this is available in Bash scripting?
The type of utility I'd like will be able to read/write via std-in/std-out or file-in/file-out, and handle Unicode, Rich Text Format, picture, etc. clipboard formats...
NB: I'm not after a clipboard manager.
xsel
I am using xsel Install xsel, but I am only using it with plain text and unicode text.
xsel
can copy and paste to three different "clipboards".By default, it uses the X Window System primary selection, which is basically whatever is currently in selection. The X Window System also has a secondary selection (which isn't used much), and a clipboard selection. You're probably looking for the clipboard selection, since that's what the desktop environment (e.g. Gnome, KDE, XFCE) uses for its clipboard. To use that with xsel:
xclip
Install xclip may be one of your choices.
you can also setting it in the .bashrc file using alias.
The key to paste binary data to a file with
xclip
is to tell what Media Types you have on clipboard. For PNG you can:So now on
~/Dropbox/.mybashrc
;) you can add an alias (clipboard2photo) to easily paste to image file (maybe someday we'll have it on Nautilus).Parcellite
I've used parcellite for many years as a clipboard manager. It runs in the Notification Area and offers many options for managing both Primary Selection and standard freedesktop.org Clipboard.
It's been my answer to managing clipboard items.
I recently came across the tools
xclip-copyfile
,xclip-cutfile
, andxclip-pastefile
(packagexclip
). These tools allow you to copy/cut/paste entire files via the command line.You can see their man page here.
clipit
clipit is a clipboard manager for GTK+ that allows piping text from the command line:
You can use CopyQ for this. From the website:
To copy a text file:
To copy an image (you need to indicate the MIME type):
To copy a data file (you need to indicate the MIME type):
Check their wiki for more documentation and usage examples.
You can install it either via the ppa:noobslab/indicators PPA or by manually downloading prepackaged
.deb
files of latest stable from the project's Downloads section.If you just want to copy some text to the clipboard:
echo -n "some-text" | xclip -selection clipboard
Pastie
A new clipboard manager with Indicator Applet support was recently released (though not in the archive yet). In addition to tracking text clipboard history it will also capture and persist data clipboard entries as well (Files, Folders, etc) which may be useful if you manipulate files a lot via a GUI/Clipboard environment.
You can add the following PPA:
ppa:hel-sheep/pastie
For RTF format I use this procedure: I copy text into clipboard in the application. If I am unsure whether it is rtf or what, I use this command to verify:
When it prints out something like this:
TARGETS
text/rtf
text/richtext
So I cannot resist to exclaim quite aloud: "Gee, that is genious! God bless linux!" After that shot prayer, just obvious thing follows:
Then I process it all in libreoffice and send to all my friends as a spam.
:-)
How about GPaste daemon settings, a clipboard management daemon applet with DBus interface:
Installation:
To install it in Ubuntu 13.10, 13.04, 12.10 or 12.04, use the commands below:
Or install
gpaste
throughsynaptic package manager
(and alsognome-shell-extensions-gpaste
if you use Gnome-Shell).Another option is the installation through
software-center
.