Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

save an image from clipboard into file using command line

Graphical Environments, Managers, Multimedia & Desktop questions.
Post Reply
Message
Author
Piter_
Posts: 208
Joined: 2006-05-30 14:23

save an image from clipboard into file using command line

#1 Post by Piter_ »

can save an image from clipboard into file using command line?
may be image magic?
Thanks.
Joybook A52 laptop. Debian stable.

BKJ
Posts: 47
Joined: 2009-03-13 12:22

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

#2 Post by BKJ »

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

User avatar
sjukfan
Posts: 386
Joined: 2010-03-01 19:39

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

#3 Post by sjukfan »

Have a look here http://linuxtidbits.wordpress.com/2008/ ... clipboard/ Seems like xclip may do what you're looking for.
Bullseye amd64, AMD Ryzen 5 3600
Buster amd64, Intel Xeon E3-1240 v3
Sid ppc, PowerPC 7447a
Sid ppc64, PowerPC 970FX

Piter_
Posts: 208
Joined: 2006-05-30 14:23

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

#4 Post by Piter_ »

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.

Post Reply