* [9fans] How to take a portion of a screenshot
@ 2016-11-23 12:28 Chris McGee
2016-11-23 15:34 ` Adriano Verardo
2016-11-23 16:06 ` Richard Miller
0 siblings, 2 replies; 20+ messages in thread
From: Chris McGee @ 2016-11-23 12:28 UTC (permalink / raw)
To: 9fans
Hi All,
I'm working on some documentation and would like to include a portion of the screen in a particular window. What's a good way to take the shot but also snip out the piece that I'm interested in?
Thanks,
Chris
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [9fans] How to take a portion of a screenshot
2016-11-23 12:28 [9fans] How to take a portion of a screenshot Chris McGee
@ 2016-11-23 15:34 ` Adriano Verardo
2016-11-23 16:06 ` Richard Miller
1 sibling, 0 replies; 20+ messages in thread
From: Adriano Verardo @ 2016-11-23 15:34 UTC (permalink / raw)
To: Fans of the OS Plan 9 from Bell Labs
I usually run Plan9 in a vm under Win7.
Chris McGee wrote:
> Hi All,
>
> I'm working on some documentation and would like to include a portion of the screen in a particular window. What's a good way to take the shot but also snip out the piece that I'm interested in?
>
> Thanks,
> Chris
>
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [9fans] How to take a portion of a screenshot
2016-11-23 12:28 [9fans] How to take a portion of a screenshot Chris McGee
2016-11-23 15:34 ` Adriano Verardo
@ 2016-11-23 16:06 ` Richard Miller
2016-11-23 16:28 ` hiro
2016-11-23 18:39 ` Chris McGee
1 sibling, 2 replies; 20+ messages in thread
From: Richard Miller @ 2016-11-23 16:06 UTC (permalink / raw)
To: 9fans
> I'm working on some documentation and would like to include a portion of the screen in a particular window. What's a good way to take the shot but also snip out the piece that I'm interested in?
Making a screenshot is one of those delightful examples of
the elegant simplicity of Plan 9:
cat /dev/screen >screenshot.pic
To select a rectangle from an image you can use crop(1)
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [9fans] How to take a portion of a screenshot
2016-11-23 16:06 ` Richard Miller
@ 2016-11-23 16:28 ` hiro
2016-11-23 18:39 ` Chris McGee
1 sibling, 0 replies; 20+ messages in thread
From: hiro @ 2016-11-23 16:28 UTC (permalink / raw)
To: Fans of the OS Plan 9 from Bell Labs
can't you take something like /dev/wsys/123/window ?
On 11/23/16, Richard Miller <9fans@hamnavoe.com> wrote:
>> I'm working on some documentation and would like to include a portion of
>> the screen in a particular window. What's a good way to take the shot but
>> also snip out the piece that I'm interested in?
>
> Making a screenshot is one of those delightful examples of
> the elegant simplicity of Plan 9:
>
> cat /dev/screen >screenshot.pic
>
> To select a rectangle from an image you can use crop(1)
>
>
>
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [9fans] How to take a portion of a screenshot
2016-11-23 16:06 ` Richard Miller
2016-11-23 16:28 ` hiro
@ 2016-11-23 18:39 ` Chris McGee
2016-11-23 20:07 ` Skip Tavakkolian
1 sibling, 1 reply; 20+ messages in thread
From: Chris McGee @ 2016-11-23 18:39 UTC (permalink / raw)
To: Fans of the OS Plan 9 from Bell Labs
Thanks Richard,
That is the kind of thing I was looking for. And yes, it's one of the reasons I'm liking plan 9. Each piece does one thing we'll.
Chris
On Nov 23, 2016, at 11:06 AM, Richard Miller <9fans@hamnavoe.com> wrote:
>> I'm working on some documentation and would like to include a portion of the screen in a particular window. What's a good way to take the shot but also snip out the piece that I'm interested in?
>
> Making a screenshot is one of those delightful examples of
> the elegant simplicity of Plan 9:
>
> cat /dev/screen >screenshot.pic
>
> To select a rectangle from an image you can use crop(1)
>
>
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [9fans] How to take a portion of a screenshot
2016-11-23 18:39 ` Chris McGee
@ 2016-11-23 20:07 ` Skip Tavakkolian
2016-11-23 20:31 ` Benjamin Purcell
2016-11-24 5:06 ` Chris McGee
0 siblings, 2 replies; 20+ messages in thread
From: Skip Tavakkolian @ 2016-11-23 20:07 UTC (permalink / raw)
To: 9fans
[-- Attachment #1: Type: text/plain, Size: 67 bytes --]
> it's one of the reasons I'm liking plan 9.
ingenious glenda.
[-- Attachment #2: window.jpg --]
[-- Type: image/jpeg, Size: 9622 bytes --]
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [9fans] How to take a portion of a screenshot
2016-11-23 20:07 ` Skip Tavakkolian
@ 2016-11-23 20:31 ` Benjamin Purcell
2016-11-23 20:36 ` James A. Robinson
2016-11-24 5:06 ` Chris McGee
1 sibling, 1 reply; 20+ messages in thread
From: Benjamin Purcell @ 2016-11-23 20:31 UTC (permalink / raw)
To: Fans of the OS Plan 9 from Bell Labs
even simpler:
tojpg < /mnt/wsys/window > window.jpg
On Wed, Nov 23, 2016 at 2:07 PM, Skip Tavakkolian <9nut@9netics.com> wrote:
>> it's one of the reasons I'm liking plan 9.
>
> ingenious glenda.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [9fans] How to take a portion of a screenshot
2016-11-23 20:07 ` Skip Tavakkolian
2016-11-23 20:31 ` Benjamin Purcell
@ 2016-11-24 5:06 ` Chris McGee
2016-11-24 7:23 ` Skip Tavakkolian
2016-11-24 8:56 ` cinap_lenrek
1 sibling, 2 replies; 20+ messages in thread
From: Chris McGee @ 2016-11-24 5:06 UTC (permalink / raw)
To: Fans of the OS Plan 9 from Bell Labs
I tried to write an rc script that would make a screen video as an animated gif. I have something that almost works, but ran into a few problems/limitations.
* I can’t seem to find a way to have an incrementing loop counter in rc shell (best I could do is check the size of a growing list variable)
* The gif command barfs when the GIF is any larger than a few megabytes due to an allocation error
* I couldn’t think of a good way to name the image files so that they can be sorted into the correct sequence as input to togif
I’ll try banging my head on the solution again tomorrow. I’m hoping that either it can be a one-liner of rc shell scripting or put into a full utility script (e.g. recscreen) that anyone could use.
Thanks,
Chris
> On Nov 23, 2016, at 3:07 PM, Skip Tavakkolian <9nut@9netics.com> wrote:
>
>> it's one of the reasons I'm liking plan 9.
>
> ingenious glenda.
> <window.jpg>
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [9fans] How to take a portion of a screenshot
2016-11-24 5:06 ` Chris McGee
@ 2016-11-24 7:23 ` Skip Tavakkolian
2016-11-24 8:56 ` cinap_lenrek
1 sibling, 0 replies; 20+ messages in thread
From: Skip Tavakkolian @ 2016-11-24 7:23 UTC (permalink / raw)
To: 9fans
> * I can’t seem to find a way to have an incrementing loop counter in rc shell (best I could do is check the size of a growing list variable)
most of the time seq(1), hoc(1) and similar tools can help do the job:
fn square {
echo $1 '*' $1 | hoc
}
for (i in `{seq 1 10}) {
j = `{square $i}
echo $i^² '=' $j
}
> * I couldn’t think of a good way to name the image files so that they can be sorted into the correct sequence as input to togif
awk printf perhaps?
for (i in (0 10 100)) {
echo $i
} | awk '{printf "image_%0.3d\n", $0}'
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [9fans] How to take a portion of a screenshot
2016-11-24 5:06 ` Chris McGee
2016-11-24 7:23 ` Skip Tavakkolian
@ 2016-11-24 8:56 ` cinap_lenrek
2016-11-26 4:23 ` Chris McGee
1 sibling, 1 reply; 20+ messages in thread
From: cinap_lenrek @ 2016-11-24 8:56 UTC (permalink / raw)
To: 9fans
rc variables are lists, and $#var evalulates to the
length of the list... you can use that to make counters
by concatenating elements to a list:
term% a=() while(! ~ $#a 13){echo $#a $a; a=(1 $a);}
0
1 1
2 1 1
3 1 1 1
4 1 1 1 1
5 1 1 1 1 1
6 1 1 1 1 1 1
7 1 1 1 1 1 1 1
8 1 1 1 1 1 1 1 1
9 1 1 1 1 1 1 1 1 1
10 1 1 1 1 1 1 1 1 1 1
11 1 1 1 1 1 1 1 1 1 1 1
12 1 1 1 1 1 1 1 1 1 1 1 1
--
cinap
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [9fans] How to take a portion of a screenshot
2016-11-24 8:56 ` cinap_lenrek
@ 2016-11-26 4:23 ` Chris McGee
2016-11-26 7:27 ` Skip Tavakkolian
0 siblings, 1 reply; 20+ messages in thread
From: Chris McGee @ 2016-11-26 4:23 UTC (permalink / raw)
To: Fans of the OS Plan 9 from Bell Labs
Thanks Skip, Cinap,
This command seems to be working quite nicely (except for the memory allocation problem in gif(1) for larger recordings):
for (i in `{seq -w 1 25}) { sleep 0.01; cat /dev/screen > /tmp/screen-$i.img }; togif -l -1 -d 300 /tmp/screen-*.img > /tmp/recording.gif; rm /tmp/screen-*.img; echo Done
It would be easy enough to introduce a crop to restrict the recording to a particular window or area of the screen.
Is there a way to capture the current mouse position without blocking to wait on an event from /dev/mouse? I was thinking that it would be interesting to crop around the current mouse position.
Chris
> On Nov 24, 2016, at 3:56 AM, cinap_lenrek@felloff.net wrote:
>
> rc variables are lists, and $#var evalulates to the
> length of the list... you can use that to make counters
> by concatenating elements to a list:
>
> term% a=() while(! ~ $#a 13){echo $#a $a; a=(1 $a);}
> 0
> 1 1
> 2 1 1
> 3 1 1 1
> 4 1 1 1 1
> 5 1 1 1 1 1
> 6 1 1 1 1 1 1
> 7 1 1 1 1 1 1 1
> 8 1 1 1 1 1 1 1 1
> 9 1 1 1 1 1 1 1 1 1
> 10 1 1 1 1 1 1 1 1 1 1
> 11 1 1 1 1 1 1 1 1 1 1 1
> 12 1 1 1 1 1 1 1 1 1 1 1 1
>
> --
> cinap
>
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [9fans] How to take a portion of a screenshot
2016-11-26 4:23 ` Chris McGee
@ 2016-11-26 7:27 ` Skip Tavakkolian
0 siblings, 0 replies; 20+ messages in thread
From: Skip Tavakkolian @ 2016-11-26 7:27 UTC (permalink / raw)
To: Fans of the OS Plan 9 from Bell Labs
[-- Attachment #1: Type: text/plain, Size: 1625 bytes --]
Nice. Looking at jpg(1) sources, it's not obvious where the allocation
limit comes in. Too bad there isn't an encoder for vp8.
for mouse position, you may need to write a shim to snoop on the mouse;
something like this:
https://github.com/9nut/plan9/tree/master/tippy
On Fri, Nov 25, 2016 at 8:23 PM Chris McGee <newton688@gmail.com> wrote:
> Thanks Skip, Cinap,
>
> This command seems to be working quite nicely (except for the memory
> allocation problem in gif(1) for larger recordings):
>
> for (i in `{seq -w 1 25}) { sleep 0.01; cat /dev/screen >
> /tmp/screen-$i.img }; togif -l -1 -d 300 /tmp/screen-*.img >
> /tmp/recording.gif; rm /tmp/screen-*.img; echo Done
>
> It would be easy enough to introduce a crop to restrict the recording to a
> particular window or area of the screen.
>
> Is there a way to capture the current mouse position without blocking to
> wait on an event from /dev/mouse? I was thinking that it would be
> interesting to crop around the current mouse position.
>
> Chris
>
>
> > On Nov 24, 2016, at 3:56 AM, cinap_lenrek@felloff.net wrote:
> >
> > rc variables are lists, and $#var evalulates to the
> > length of the list... you can use that to make counters
> > by concatenating elements to a list:
> >
> > term% a=() while(! ~ $#a 13){echo $#a $a; a=(1 $a);}
> > 0
> > 1 1
> > 2 1 1
> > 3 1 1 1
> > 4 1 1 1 1
> > 5 1 1 1 1 1
> > 6 1 1 1 1 1 1
> > 7 1 1 1 1 1 1 1
> > 8 1 1 1 1 1 1 1 1
> > 9 1 1 1 1 1 1 1 1 1
> > 10 1 1 1 1 1 1 1 1 1 1
> > 11 1 1 1 1 1 1 1 1 1 1 1
> > 12 1 1 1 1 1 1 1 1 1 1 1 1
> >
> > --
> > cinap
> >
>
>
>
[-- Attachment #2: Type: text/html, Size: 2913 bytes --]
^ permalink raw reply [flat|nested] 20+ messages in thread
end of thread, other threads:[~2016-11-28 6:30 UTC | newest]
Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-23 12:28 [9fans] How to take a portion of a screenshot Chris McGee
2016-11-23 15:34 ` Adriano Verardo
2016-11-23 16:06 ` Richard Miller
2016-11-23 16:28 ` hiro
2016-11-23 18:39 ` Chris McGee
2016-11-23 20:07 ` Skip Tavakkolian
2016-11-23 20:31 ` Benjamin Purcell
2016-11-23 20:36 ` James A. Robinson
2016-11-23 20:41 ` hiro
2016-11-23 20:56 ` Skip Tavakkolian
[not found] ` <CAEVxPTOrWFf2hd-nWDeP8GE5qSjhqB6Ox=W1C9FhrVt9S70V-g@mail.gmail.com>
[not found] ` <CAEVxPTP5L2=SpYEn96QUpsZ1VDjUwTKUzxCNp+WVoJqVCDocvg@mail.gmail.com>
2016-11-23 21:30 ` Jules Merit
2016-11-23 21:57 ` Steve Simon
2016-11-23 22:16 ` Jules Merit
2016-11-28 6:30 ` erik quanstrom
2016-11-23 20:48 ` Skip Tavakkolian
2016-11-24 5:06 ` Chris McGee
2016-11-24 7:23 ` Skip Tavakkolian
2016-11-24 8:56 ` cinap_lenrek
2016-11-26 4:23 ` Chris McGee
2016-11-26 7:27 ` Skip Tavakkolian
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).