save an image from clipboard into file using command line

Everything about X, Gnome, KDE, ... and everything running on it

save an image from clipboard into file using command line

Postby Piter_ » 2011-04-28 21:16

can save an image from clipboard into file using command line?
may be image magic?
Thanks.
Joybook A52 laptop. Debian stable.
Piter_
 
Posts: 208
Joined: 2006-05-30 14:23

Re: save an image from clipboard into file using command lin

Postby BKJ » 2011-05-01 04:00

try scrot or image magic. here is a simple quick and dirty script using either one of them:

Code: Select all
#!/bin/bash

# Screenshot script

# Variables
TIMESTAMP=$(date '+%m-%d-%Y-[%I:%M:%S]')

# Command
## Imagemagick
import -quality 100 -silent $HOME/screenshot-$TIMESTAMP.png
## Scrot
#scrot -q40 -sd5 $HOME/screenshot-$TIMESTAMP.png


Either one of those will let you select either a window or region. Hope this helps.
Debian Testing/Unstable rigs.... amd64
BKJ
 
Posts: 47
Joined: 2009-03-13 12:22

Re: save an image from clipboard into file using command lin

Postby sjukfan » 2011-05-01 21:06

Have a look here http://linuxtidbits.wordpress.com/2008/ ... clipboard/ Seems like xclip may do what you're looking for.
Debian Jessie, Core 2 Duo
Debian Squeeze LTS, Atom D510
Debian Wheezy, NSLU2 Intel IXP420
Debian Jessie, Thinkpad T43
User avatar
sjukfan
 
Posts: 296
Joined: 2010-03-01 19:39

Re: save an image from clipboard into file using command lin

Postby Piter_ » 2011-05-02 09:19

Thank you guys.
I know about command line printscreen command, It is binded to my prtscr key in awesome window manager.
But it makes copy of screen and i need a copy of some selected part, for example picture from pdf.
The problem with xclip is that it works only with text, or at least I have not managed to make it work with image.

But i think i have found the solution:
http://stackoverflow.com/questions/1868 ... d-with-x11
Joybook A52 laptop. Debian stable.
Piter_
 
Posts: 208
Joined: 2006-05-30 14:23


Return to Desktop & Multimedia

Who is online

Users browsing this forum: No registered users and 9 guests

fashionable