9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] Q: About screenshots (putting things in perspective)
@ 2003-10-05 19:13 mirtchov
  0 siblings, 0 replies; only message in thread
From: mirtchov @ 2003-10-05 19:13 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 1241 bytes --]

for those of you who find the usefulness of /dev/screen questionable
and would like to see (in the good ol' unix tradition) a
special-purpose tool whose only job is to take a screenshot and write
it do stdout, i present the 'screenshot' utility attached.  note, to
be compliant with various lunixes you may need to copy it as
'snapshot', 'screengrab', 'grabscreen', 'screendump', 'snap' and 'xv
-grab -root -quit' so there will be no confusion among those used to
different unix variants.

i'll start working on the gui as soon as i'm done adding the -v option.

cheers, andrey

to compile:

	% 8c -FVw screenshot.c
	% 8l screenshot.8

to use:

	% 8.out | page

here's the man page:

     SCREENSHOT(1)                                                     SCREENSHOT(1)

     NAME
          screenshot - take a snapshot of the current display.

     SYNOPSIS
          screenshot

     DESCRIPTION
	Screenshot takes a snap of the current display and writes it
	as an image(6) format to standard output.

     SEE ALSO
          graphics(2),rio(1)

     BUGS
 	 Lacks a '-v' option.

	If the display is updated while the image is being written out
	the machine crashes and requires several reboots.

[-- Attachment #2: screenshot.c --]
[-- Type: text/plain, Size: 159 bytes --]

#include <u.h>
#include <libc.h>
#include <draw.h>

void
main()
{
	initdraw(nil, nil, "choatesnap");
	writeimage(1, display->image, 0);
	exits("");
}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-10-05 19:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-05 19:13 [9fans] Q: About screenshots (putting things in perspective) mirtchov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).