Re: X11 screen grabber from cmd line
On Fri, 10 May 2013 09:29:07 +0200, Matthias Apitz wrote: > El día Friday, May 10, 2013 a las 08:23:45AM +0100, Matthew Seaman escribió: > > > You're somewhat missing the point here, I'm afraid. There are many > > alternatives for grabbing screen shots from *within* an X session > > itself. What the OP wants is a way to grab a screenshot of an X session > > from a different, non-graphical terminal. > > > > Exactly! But, more: the launched tool (which has access via $DISPLAY to > the X server) must grab the screen *without* any further interaction on > the screen (i.e. selecting a region or a mouse click is not an option); > > thanks for all the pointers, I will test and see what fits; Exactly that's what has been my suggestion (without having been mentioned): both "xwd" and "import" support a -display option. In case the root window (equals the whole screen) is captured, no further interaction is required (at least in case of xwd). This makes it easy to obtain screenshots non-interactively (e. g. time-triggered) from "outside" the X session. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ... ___ [email protected] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[email protected]"
Re: X11 screen grabber from cmd line
El día Friday, May 10, 2013 a las 08:23:45AM +0100, Matthew Seaman escribió: > You're somewhat missing the point here, I'm afraid. There are many > alternatives for grabbing screen shots from *within* an X session > itself. What the OP wants is a way to grab a screenshot of an X session > from a different, non-graphical terminal. > Exactly! But, more: the launched tool (which has access via $DISPLAY to the X server) must grab the screen *without* any further interaction on the screen (i.e. selecting a region or a mouse click is not an option); thanks for all the pointers, I will test and see what fits; matthias -- Sent from my FreeBSD netbook Matthias Apitz | - No system with backdoors like Apple/Android E-mail: [email protected] | - Never being an iSlave WWW: http://www.unixarea.de/ | - No proprietary attachments, no HTML/RTF in E-mail phone: +49-170-4527211 | - Respect for open standards ___ [email protected] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[email protected]"
Re: X11 screen grabber from cmd line
On 10/05/2013 07:09, Polytropon wrote: > On Thu, 9 May 2013 20:41:45 +0200, Matthias Apitz wrote: >> Do we have something in the ports which could do a screen shoot of $DISPLAY, >> but >> from the cmd line of an alpha console, and save it as PNG or JPEG? > > % xwd -out screen.xwd > % convert screen.xwd screen.png > -or- > % convert screen.xwd screen.jpg > > But if you've got installed ImageMagic (the "convert" command) > anyway, you can also use > > % import screen.jpg > -or- > % import screen.png > > For a whole screen capture, "xwd -root" or "import -screen" can > be used. You're somewhat missing the point here, I'm afraid. There are many alternatives for grabbing screen shots from *within* an X session itself. What the OP wants is a way to grab a screenshot of an X session from a different, non-graphical terminal. Now, if you know the $DISPLAY setting for the screen in question, and you can wrangle xauth(1) into letting you have access to that display, then you should be able to run any of the suggested programs from any separate command line interface on the system. The xauth(1) man page is reasonably clear, and if you're logged into the same Unix accout as the user running the display, it might just work only by setting $DISPLAY appropriately in your environment. Note that allowing other users to access your X session like this means they can snoop on anything you do in that session, including recording any passwords you type and so forth. Don't give out such access except to people you trust. Cheers, Matthew ___ [email protected] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[email protected]"
Re: X11 screen grabber from cmd line
On Thu, 9 May 2013 20:41:45 +0200 Matthias Apitz wrote: > > Hello, > > Do we have something in the ports which could do a screen shoot of $DISPLAY, > but > from the cmd line of an alpha console, and save it as PNG or JPEG? graphics/scrot, it's exports to png, jpeg and can select a zone interactivitly. The command i use is: scrot -s '%Y-%m-%d_%H-%M-%S.png' > Thx > > matthias --- --- Eduardo Morras ___ [email protected] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[email protected]"
Re: X11 screen grabber from cmd line
On Thu, 9 May 2013 20:41:45 +0200, Matthias Apitz wrote: > Do we have something in the ports which could do a screen shoot of $DISPLAY, > but > from the cmd line of an alpha console, and save it as PNG or JPEG? % xwd -out screen.xwd % convert screen.xwd screen.png -or- % convert screen.xwd screen.jpg But if you've got installed ImageMagic (the "convert" command) anyway, you can also use % import screen.jpg -or- % import screen.png For a whole screen capture, "xwd -root" or "import -screen" can be used. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ... ___ [email protected] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[email protected]"
Re: X11 screen grabber from cmd line
> Do we have something in the ports which could do a screen shoot > of $DISPLAY, but from the cmd line of an alpha console, > and save it as PNG or JPEG? #!/bin/sh xwd -display :0 | xwdtopnm | ppmtojpeg -optimize > $1.jpg ~ # pkg_which xwd xwd-1.0.5 ~ # pkg_which xwdtopnm netpbm-10.35.89 ~ # pkg_which ppmtojpeg netpbm-10.35.89 ___ [email protected] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[email protected]"
Re: X11 screen grabber from cmd line
On 9 May 2013 17:33, [email protected] wrote: > > On 9 May 2013 14:41, Matthias Apitz wrote: > >> >> Hello, >> >> Do we have something in the ports which could do a screen shoot of >> $DISPLAY, but >> from the cmd line of an alpha console, and save it as PNG or JPEG? >> Thx >> >> matthias >> > > I use a simple script: > > cat scripts/screenshot > #!/bin/sh > xwd -root | xwdtopnm | pnmtopng > screenshot_${1}.png > > which uses x11/xwd & graphics/netpbm > > -- > -- > I just realised you might mean the text console, in which case ignore that. Look at the -p & -P options to vidcontrol(1). -- -- ___ [email protected] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[email protected]"
Re: X11 screen grabber from cmd line
ImageMagick port can do this using command import. $ which import /usr/local/bin/import $ import --help Version: ImageMagick 6.8.0-7 2013-03-06 Q16 http://www.imagemagick.org Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC Features: Usage: import [options ...] [ file ] Image Settings: -adjoin join images into a single multi-image file -border include window border in the output image -channel typeapply option to select image channels -colorspace type alternate image colorspace -comment string annotate image with comment -compress type type of pixel compression when writing the image -define format:option define one or more image format options -density geometryhorizontal and vertical density of the image -depth value image depth -descend obtain image by descending window hierarchy -display server X server to contact -dispose method layer disposal method -dither method apply error diffusion to image -delay value display the next image after pausing -encipher filename convert plain pixels to cipher pixels -endian type endianness (MSB or LSB) of the image -encoding type text encoding type -filter type use this filter when resizing an image -format "string" output formatted image characteristics -frame include window manager frame -gravity direction which direction to gravitate towards -identifyidentify the format and characteristics of the image -interlace type None, Line, Plane, or Partition -interpolate method pixel color interpolation method -label stringassign a label to an image -limit type valueArea, Disk, Map, or Memory resource limit -monitor monitor progress -page geometry size and location of an image canvas -pause value seconds delay between snapshots -pointsize value font point size -quality value JPEG/MIFF/PNG compression level -quiet suppress all warning messages -regard-warnings pay attention to warning messages -respect-parentheses settings remain in effect until parenthesis boundary -sampling-factor geometry horizontal and vertical sampling factor -scene value image scene number -screen select image from root window -seed value seed a new sequence of pseudo-random numbers -set property value set an image property -silent operate silently, i.e. don't ring any bells -snaps value number of screen snapshots -synchronize synchronize image to storage device -taint declare the image as modified -transparent-color color transparent color -treedepth value color tree depth -verbose print detailed information about the image -virtual-pixel method Constant, Edge, Mirror, or Tile -window id select window with this id or name Image Operators: -annotate geometry text annotate the image with text -colors valuepreferred number of colors in the image -crop geometry preferred size and location of the cropped image -encipher filename convert plain pixels to cipher pixels -geometry geometry preferred size or location of the image -helpprint program options -monochrome transform image to black and white -negate replace every pixel with its complementary color -repage geometry size and location of an image canvas -quantize colorspace reduce colors in this colorspace -resize geometry resize the image -rotate degrees apply Paeth rotation to the image -strip strip image of all profiles and comments -thumbnail geometry create a thumbnail of the image -transparent color make this color transparent within the image -trimtrim image edges -type type image type Miscellaneous Options: -debug eventsdisplay copious debugging information -helpprint program options -list type print a list of supported option arguments -log format format of debugging information -version print version information By default, 'file' is written in the MIFF image format. To specify a particular image format, precede the filename with an image format name and a colon (i.e. ps:image) or specify the image type as the filename suffix (i.e. image.ps). Specify 'file' as '-' for standard input or output. $ Best Regards, Antonio On Thu, May 9, 2013 at 1:41 PM, Matthias Apitz wrote: > > Hello, > > Do we have something in the ports which could do a screen shoot of $DISPLAY, > but > from the cmd line of an alpha console, and save it as PNG or JPEG? > Thx > > matthias > -- > Sent from my FreeBSD
