LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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

Reply
 
LinkBack Search this Thread
Old 12-05-2010, 01:47 PM   #1
Xeratul
Senior Member
 
Registered: Jun 2006
Location: Debian Land
Posts: 1,241

Rep: Reputation: 81
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??

Last edited by Xeratul; 12-07-2010 at 05:09 PM.
 
Old 12-06-2010, 10:12 AM   #2
thesnow
Member
 
Registered: Nov 2010
Location: Minneapolis, MN
Distribution: Ubuntu, Red Hat, Mint
Posts: 113

Rep: Reputation: 25
I have not used it, but xclip claims to be able to do this.

http://sourceforge.net/projects/xclip/
 
Old 12-06-2010, 02:24 PM   #3
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,516
Blog Entries: 27

Rep: Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174
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.
 
Old 12-06-2010, 04:20 PM   #4
thesnow
Member
 
Registered: Nov 2010
Location: Minneapolis, MN
Distribution: Ubuntu, Red Hat, Mint
Posts: 113

Rep: Reputation: 25
Quote:
Originally Posted by catkin View Post
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.
 
Old 12-06-2010, 05:28 PM   #5
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,698

Rep: Reputation: 287Reputation: 287Reputation: 287
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
 
Old 12-06-2010, 11:11 PM   #6
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,516
Blog Entries: 27

Rep: Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174
Quote:
Originally Posted by bigrigdriver View Post
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.
 
Old 12-07-2010, 03:25 PM   #7
Xeratul
Senior Member
 
Registered: Jun 2006
Location: Debian Land
Posts: 1,241

Original Poster
Rep: Reputation: 81
Quote:
Originally Posted by bigrigdriver View Post
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

Last edited by Xeratul; 12-07-2010 at 03:27 PM.
 
Old 12-07-2010, 03:36 PM   #8
Xeratul
Senior Member
 
Registered: Jun 2006
Location: Debian Land
Posts: 1,241

Original Poster
Rep: Reputation: 81
Quote:
Originally Posted by catkin View Post
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 ...

Last edited by Xeratul; 12-07-2010 at 05:10 PM.
 
Old 12-07-2010, 10:37 PM   #9
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,516
Blog Entries: 27

Rep: Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174
Where (while running which application) do you want to do the Ctrl+C?
 
Old 12-08-2010, 02:42 PM   #10
Xeratul
Senior Member
 
Registered: Jun 2006
Location: Debian Land
Posts: 1,241

Original Poster
Rep: Reputation: 81
Quote:
Originally Posted by catkin View Post
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
 
Old 12-08-2010, 03:06 PM   #11
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
Quote:
Originally Posted by Xeratul View Post
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.

Last edited by stress_junkie; 12-08-2010 at 03:08 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How can I create a png or jpeg file programatically ? alanv Linux - Newbie 6 10-03-2010 03:42 PM
Command to put texfile in the clipboard? enemorales Linux - Software 0 02-09-2005 03:21 AM
Html file to Jpeg or Png? akihandyman Mandriva 2 10-02-2004 10:00 AM
Image conversor bmp & png to jpeg Adony Linux - Software 2 06-19-2004 03:43 PM
jpeg and png library for gd upr8830 Linux - Software 4 06-11-2003 04:49 PM


All times are GMT -5. The time now is 03:14 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration