LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   BASH/Dash : how to put a JPEG or PNG into the Clipboard? (https://www.linuxquestions.org/questions/linux-general-1/bash-dash-how-to-put-a-jpeg-or-png-into-the-clipboard-848493/)

Xeratul 12-05-2010 01:47 PM

BASH/Dash : how to put a JPEG or PNG into the Clipboard?
 
Hi,

I would like to copy a jpeg or a png and place it into the clipboard of X11 of my icewm. any ideas which program can do cat "myfile.jpg" > ?theclipboardofx11??

thesnow 12-06-2010 10:12 AM

I have not used it, but xclip claims to be able to do this.

http://sourceforge.net/projects/xclip/

catkin 12-06-2010 02:24 PM

AFAIK xclip only works with text but it would be nice to be wrong. From the xclip man page:
Code:

DESCRIPTION
    Reads from standard in, or from one or more files, and makes the data available as an X selection for pasting into X
    applications. Prints current X selection to standard out.


thesnow 12-06-2010 04:20 PM

Quote:

Originally Posted by catkin (Post 4182601)
AFAIK xclip only works with text but it would be nice to be wrong. From the xclip man page:
Code:

DESCRIPTION
    Reads from standard in, or from one or more files, and makes the data available as an X selection for pasting into X
    applications. Prints current X selection to standard out.


After further review, you appear to be correct.

bigrigdriver 12-06-2010 05:28 PM

There is an app called mtpaint, which has this to say about copying images to the clipboard using mtpaint:
Quote:

A.3 Grabbing Screenshots

mtPaint can be used to grab a screenshot with either 'File->New' or using 'mtpaint -s' from the command line. If you are an IceWM user you can assign the key 'Print Screen' to grab a screenshot by editing the file ~/.icewm/keys to include:

key "Print" mtpaint -s

catkin 12-06-2010 11:11 PM

Quote:

Originally Posted by bigrigdriver (Post 4182828)
There is an app called mtpaint, which has this to say about copying images to the clipboard using mtpaint:

Still not answering the OP question about how whether it is possible to put the contents of a JPEG or PNG file into the clipboard but giving some possibly relevant information ...

When you copy (Ctrl+C) a JPEG or PNG file in Thunar (Xfce's file manager) and then paste into a text document the pasted text is a URL, for example file:///home/c/d/Pictographic/IMG_1368.jpg

Does mtpaint copy to the clipboard or to file? Screenshot, a similar app, either copies to file or opens in an editor (via a file). X Window selections can contain images but goes on to describe copying only text.

There is more in the Inter-Client Communication Conventions Manual.

Xeratul 12-07-2010 03:25 PM

Quote:

Originally Posted by bigrigdriver (Post 4182828)
There is an app called mtpaint, which has this to say about copying images to the clipboard using mtpaint:

sounds on good way but a window appears :( , well we have to do maybe

Code:

key "Print" ' mtpaint -s & killall -e mtpaint  '
what do u think ?

Quote:

$ mtpaint --help
mtPaint 3.31

Usage: mtpaint [option] [imagefile ... ]

Options:
--help Output this help
--version Output version information
-s Grab screenshot
-v Start in viewer mode
i use openbox, icewm and blackbox

Xeratul 12-07-2010 03:36 PM

Quote:

Originally Posted by catkin (Post 4183055)
Still not answering the OP question about how whether it is possible to put the contents of a JPEG or PNG file into the clipboard but giving some possibly relevant information ...

When you copy (Ctrl+C) a JPEG or PNG file in Thunar (Xfce's file manager) and then paste into a text document the pasted text is a URL, for example file:///home/c/d/Pictographic/IMG_1368.jpg

Does mtpaint copy to the clipboard or to file? Screenshot, a similar app, either copies to file or opens in an editor (via a file). X Window selections can contain images but goes on to describe copying only text.

There is more in the Inter-Client Communication Conventions Manual.

well I would like it to work like mac or vista

ctrl + c
then into gmail
ctrl +v
then image is paste

like vista

linux is better than vista, sure we camn do such simple thing ...:)

catkin 12-07-2010 10:37 PM

Where (while running which application) do you want to do the Ctrl+C?

Xeratul 12-08-2010 02:42 PM

Quote:

Originally Posted by catkin (Post 4184236)
Where (while running which application) do you want to do the Ctrl+C?

just would like to store a jpg into the clipbard using bash ... it is for openbox bindings

stress_junkie 12-08-2010 03:06 PM

Quote:

Originally Posted by Xeratul (Post 4185098)
just would like to store a jpg into the clipbard using bash ... it is for openbox bindings

That isn't like Vista at all. Can you do this in Vista from the command line? I don't think so. I just looked it up. All I got was how to copy the output of the command line commands to the clipboard.

In X as in Windows you can do this using the mouse.

Keep in mind that different window managers have different capabilities. If you want a lot of fancy functions then you may need to use a fancy window manager/desktop environment such as Gnome or KDE.


All times are GMT -5. The time now is 06:56 PM.