Discussion:
[gentoo-user] how to copy a file's content to clipboard?
(too old to reply)
Qiangning Hong
2005-08-12 16:00:25 UTC
Permalink
Do you know how to copy the content of a file to the X clipboard using
command? Every time now I need to paste a file into my email, I have to
cat it in a terminal and use mouse to select the text. Is there a more
convenient way?
--
Qiangning Hong

I'm usually annoyed by IDEs because, for instance, they don't use VIM
as an editor. Since I'm hooked to that, all IDEs I've used so far have
failed to impress me.
-- Sybren Stuvel @ c.l.python

Get Firefox!
<http://www.spreadfirefox.com/?q=affiliates&amp;id=67907&amp;t=1>
--
gentoo-***@gentoo.org mailing list
Uwe Thiem
2005-08-12 16:30:15 UTC
Permalink
Post by Qiangning Hong
Do you know how to copy the content of a file to the X clipboard using
command? Every time now I need to paste a file into my email, I have to
cat it in a terminal and use mouse to select the text. Is there a more
convenient way?
Depends on your mailer. In KDE's kmail, I just click Message -> Insert File.
Since you are using Thunderbird, I am pretty sure it offers something
similar.

Uwe
--
95% of all programmers rate themselves among the top 5% of all software
developers. - Linus Torvalds

http://www.uwix.iway.na (last updated: 20.06.2004)
--
gentoo-***@gentoo.org mailing list
Qiangning Hong
2005-08-12 16:50:12 UTC
Permalink
Post by Uwe Thiem
Post by Qiangning Hong
Do you know how to copy the content of a file to the X clipboard using
command? Every time now I need to paste a file into my email, I have to
cat it in a terminal and use mouse to select the text. Is there a more
convenient way?
Depends on your mailer. In KDE's kmail, I just click Message -> Insert File.
Since you are using Thunderbird, I am pretty sure it offers something
similar.
Do you means there isn't an X or desktop environment level utility?
What if I want to paste the content of a file in other places, i.e. fill
a textarea in web browser?

In my cygwin time, the command "cat myfile > /dev/clipboard" was quite
handy. I hadn't expected that I am missing a windows function when I am
under Linux, ever.

P.S. It seems Thunderbird doesn't provide this kind of function except
using attachment. :(
--
Qiangning Hong

I'm usually annoyed by IDEs because, for instance, they don't use VIM
as an editor. Since I'm hooked to that, all IDEs I've used so far have
failed to impress me.
-- Sybren Stuvel @ c.l.python

Get Firefox!
<http://www.spreadfirefox.com/?q=affiliates&amp;id=67907&amp;t=1>
--
gentoo-***@gentoo.org mailing list
Willie Wong
2005-08-12 17:10:07 UTC
Permalink
Post by Qiangning Hong
Post by Uwe Thiem
Post by Qiangning Hong
Do you know how to copy the content of a file to the X clipboard using
command? Every time now I need to paste a file into my email, I have to
cat it in a terminal and use mouse to select the text. Is there a more
convenient way?
Depends on your mailer. In KDE's kmail, I just click Message -> Insert File.
Since you are using Thunderbird, I am pretty sure it offers something
similar.
Do you means there isn't an X or desktop environment level utility?
What if I want to paste the content of a file in other places, i.e. fill
a textarea in web browser?
If you run KDE, you can probably use some incantation magic with
klipper and DCOP.

Otherwise, try xcut or xclip

[12:59 PM]wwong ~ $ emerge search xcut xclip
Searching...
[ Results for search key : xcut ]
[ Applications found : 1 ]

* x11-misc/xcut
Latest version available: 0.2
Latest version installed: [ Not Installed ]
Size of downloaded files: 10 kB
Homepage: http://xcut.sourceforge.net
Description: Commandline tool to manipulate the X11 cut and paste buffers
License: GPL-2


Searching...
[ Results for search key : xclip ]
[ Applications found : 2 ]

* x11-apps/xclipboard [ Masked ]
Latest version available: 0.99.0
Latest version installed: [ Not Installed ]
Size of downloaded files: 58 kB
Homepage: http://xorg.freedesktop.org/
Description: X.Org xclipboard application
License: X11

* x11-misc/xclip
Latest version available: 0.08
Latest version installed: [ Not Installed ]
Size of downloaded files: 27 kB
Homepage: http://people.debian.org/~kims/xclip/
Description: Command-line utility to read data from standard in and place it in an X selection for pasting into X applications.
License: GPL-2


HTH,

W
--
If I could reach up an pick one star for everytime you've made me smile, the
whole evening sky would be in the palm of my hand.
Sortir en Pantoufles: up 20:00
--
gentoo-***@gentoo.org mailing list
Neil Bothwick
2005-08-12 19:30:06 UTC
Permalink
Post by Qiangning Hong
Do you know how to copy the content of a file to the X clipboard using
command? Every time now I need to paste a file into my email, I have to
cat it in a terminal and use mouse to select the text. Is there a more
convenient way?
Use xclip, it does just what you want, and the reverse. It's in portage.
--
Neil Bothwick

I've got a mind like a... a... what's that thing called?
Loading...