Automated screenshot?

Non release banter
Post Reply
User avatar
Rava
Contributor
Contributor
Posts: 1319
Joined: 11 Jan 2011, 02:46
Distribution: Porteus 3.1.0 x86-64 XFCe
Location: Germany

Automated screenshot?

Post#1 by Rava » 26 Jun 2017, 19:19

I have with my 3.1 XFCe x86-64 Porteus two programs that can take a screen shot: xfce4-screenshooter and mtpaint.

Both can be started from the terminal, which is what I want... but both are not able to do that fully automatic, as in: start up, take the screenshot and save it in a given folder, then exit by itself.

At least both man pages don't tell me how that can be done. There is always the "save file as" window open when using xfce4-screenshooter, or mtpaint just opens the screenshot in its edit window.


But I need it fully automated, e.g. have a screenshot every 30 minutes, and then after some hours take a screenshot every minute prior putting the machine into suspend, the idea being that no one is at the PC at that time so the screen shooter needs to do the screenshot, saving in given folder and exiting all by itself.


Any ideas? Is there a hidden feature in xfce4-screenshooter or mtpaint that the man page omits?


The versions I use:
mtPaint 3.40
xfce4-screenshooter 1.8.1


Hope someone has a solution. I presume that would be a 3rd program... *plays melody of ´the third man` in his head* :D
Cheers!
Yours Rava

beny
Full of knowledge
Full of knowledge
Posts: 730
Joined: 02 Jan 2011, 11:33
Location: italy

Re: Automated screenshot?

Post#2 by beny » 26 Jun 2017, 19:56

hi rava seem you have to use crontab to run a script that allow to take a screeshoot every x time...

User avatar
Rava
Contributor
Contributor
Posts: 1319
Joined: 11 Jan 2011, 02:46
Distribution: Porteus 3.1.0 x86-64 XFCe
Location: Germany

Re: Automated screenshot?

Post#3 by Rava » 26 Jun 2017, 20:53

beny wrote:hi rava seem you have to use crontab to run a script that allow to take a screeshoot every x time...
Coding the script is not the issue, but none of the two programs do a screenshot fully automated, they both want the user to save the file. That's the issue, not starting the screen shooter at time X...

Sorry for being not clear enough on the issue.
Cheers!
Yours Rava

donald
Full of knowledge
Full of knowledge
Posts: 1224
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

Re: Automated screenshot?

Post#4 by donald » 26 Jun 2017, 22:25

Hi Rava
both want the user to save the file
You do not need mtpaint for this...you can use "imagemagick"
(package is "default".. see /var/log/packages)
(EXAMPLE) as an inspiration.. :)

Code: Select all

#!/bin/bash
echo "Enter a file name"
read filename
import -window root $HOME/Desktop/$filename.png
I'm sure you are able to modify this snipped and add the time steps you need.
..make a lot of screenshots or overwrite the last etc...

maybe better without asking for a filename -- just date and time as the filename

Code: Select all

#!/bin/bash
filename=$(date '+%d.%m.%Y_%H:%M')
import -window root $HOME/Screenshots/$filename.png

User avatar
Rava
Contributor
Contributor
Posts: 1319
Joined: 11 Jan 2011, 02:46
Distribution: Porteus 3.1.0 x86-64 XFCe
Location: Germany

Re: Automated screenshot?

Post#5 by Rava » 27 Jun 2017, 04:34

Dank Dir und thanks Donald, I know that imagemagick (or GraphicsMagick xD) "GraphicsMagick is a fork of ImageMagick, emphasizing stability of both programming API and command-line options." (source: wikipedia Dr. Copy & Mr. Paste) is able to do so but... compressed module size of 6.46 MB for imagemagick or 2.29 MB for GraphicsMagick is quite the overkill for just a screen shooter...

Code: Select all

$ du -h *magi*
2.3M	graphicsmagick-1.3.17-x86_64-1cf.xzm
6.5M	imagemagick-6.7.7_10-x86_64-1.xzm
I hope there is yet another small program that can handle screenshots like *magick does... 8)

And yes, I would have also used

Code: Select all

filename=${screenshotsave}/$(date '+%d.%m.%Y_%H:%M')
. :D :friends:
Cheers!
Yours Rava

donald
Full of knowledge
Full of knowledge
Posts: 1224
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

Re: Automated screenshot?

Post#6 by donald » 27 Jun 2017, 04:39

imagemagick-6.9.4_9-i586-1 is already included in stock porteus 3.2.2 (xfce)
-- no need to install extra/additional packages.
I don't know if it is the same in 3.1 you are (still) using..?.. :wink:
search for imagemagick in /var/log/packages

User avatar
Rava
Contributor
Contributor
Posts: 1319
Joined: 11 Jan 2011, 02:46
Distribution: Porteus 3.1.0 x86-64 XFCe
Location: Germany

Re: Automated screenshot?

Post#7 by Rava » 27 Jun 2017, 04:55

Finally I realized the errors of my way, and why 3.2.2 (and newer) won't start: initrd wants the sgn file in a folder named "/porteus/", just having /Porteus:3.2.2/ won't work... :lol:

So yes, *magic is not by default for me. Because not enough time to setup the new system the way I want. After the move out of this flat I will do so, aka next month.
Cheers!
Yours Rava

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 977
Joined: 20 Mar 2012, 03:42
Distribution: 3.2.2-64bit xfce/openbox
Location: australia
Contact:

Re: Automated screenshot?

Post#8 by ncmprhnsbl » 27 Jun 2017, 07:25

not sure if imlib2 is included in 3.1, if not , easy to get and is quite small ...has some basic tools including a screen grabber...

Code: Select all

$ imlib2_grab screenshot.png
(some screenshooters actually use this(scrot)
this page has lots of info: https://wiki.archlinux.org/index.php/Ta ... Screenshot
you can even use ffmpeg...

Code: Select all

$ ffmpeg -f x11grab -video_size widthxheight -i $DISPLAY -vframes 1 screen.png
Forum Rules : http://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
Rava
Contributor
Contributor
Posts: 1319
Joined: 11 Jan 2011, 02:46
Distribution: Porteus 3.1.0 x86-64 XFCe
Location: Germany

Re: Automated screenshot?

Post#9 by Rava » 27 Jun 2017, 08:53

Thanks,
imlib2_grab $(date '+%Y.%m.%d_%H:%M:%S').png is just what I wanted. <B
Cheers!
Yours Rava

Post Reply