9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [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:31       ` Benjamin Purcell
@ 2016-11-23 20:36         ` James A. Robinson
  2016-11-23 20:41           ` hiro
  2016-11-23 20:48           ` Skip Tavakkolian
  0 siblings, 2 replies; 20+ messages in thread
From: James A. Robinson @ 2016-11-23 20:36 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

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

On Wed, Nov 23, 2016 at 12:33 PM Benjamin Purcell <benjapurcell@gmail.com>
wrote:
> even simpler:
>
> tojpg < /mnt/wsys/window > window.jpg

Simpler because you're capturing a specific window in this case?

[-- Attachment #2: Type: text/html, Size: 352 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [9fans] How to take a portion of a screenshot
  2016-11-23 20:36         ` James A. Robinson
@ 2016-11-23 20:41           ` hiro
  2016-11-23 20:56             ` Skip Tavakkolian
  2016-11-23 20:48           ` Skip Tavakkolian
  1 sibling, 1 reply; 20+ messages in thread
From: hiro @ 2016-11-23 20:41 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

i have a slightly related question: how do i find out an other
window's window id if there is no shell temporarily available? e.g.
doom is running inside.



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [9fans] How to take a portion of a screenshot
  2016-11-23 20:36         ` James A. Robinson
  2016-11-23 20:41           ` hiro
@ 2016-11-23 20:48           ` Skip Tavakkolian
  1 sibling, 0 replies; 20+ messages in thread
From: Skip Tavakkolian @ 2016-11-23 20:48 UTC (permalink / raw)
  To: 9fans

>> tojpg < /mnt/wsys/window > window.jpg
>
> Simpler because you're capturing a specific window in this case?

yes. from rio(1):

"/mnt/wsys              Files served by rio (also unioned in
                                 /dev in a window's name space, before
                                 the terminal's real /dev files)"




^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [9fans] How to take a portion of a screenshot
  2016-11-23 20:41           ` hiro
@ 2016-11-23 20:56             ` Skip Tavakkolian
       [not found]               ` <CAEVxPTOrWFf2hd-nWDeP8GE5qSjhqB6Ox=W1C9FhrVt9S70V-g@mail.gmail.com>
  0 siblings, 1 reply; 20+ messages in thread
From: Skip Tavakkolian @ 2016-11-23 20:56 UTC (permalink / raw)
  To: 9fans

> i have a slightly related question: how do i find out an other
> window's window id if there is no shell temporarily available? e.g.
> doom is running inside.

maybe 'grep doom /dev/wsys/*/label' ?




^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [9fans] How to take a portion of a screenshot
       [not found]                 ` <CAEVxPTP5L2=SpYEn96QUpsZ1VDjUwTKUzxCNp+WVoJqVCDocvg@mail.gmail.com>
@ 2016-11-23 21:30                   ` Jules Merit
  2016-11-23 21:57                     ` Steve Simon
  2016-11-28  6:30                     ` erik quanstrom
  0 siblings, 2 replies; 20+ messages in thread
From: Jules Merit @ 2016-11-23 21:30 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs


[-- Attachment #1.1: Type: text/plain, Size: 480 bytes --]

I ported doom, after someone Runed plan9. Trying to get 9front Jurassic
Park on MIPS r12k now.

Also plan9 clearly needs EEG for user defined scheduler and jukebox
selection whilst in the labs.

On Nov 23, 2016 12:57 PM, "Skip Tavakkolian" <9nut@9netics.com> wrote:

> i have a slightly related question: how do i find out an other
> window's window id if there is no shell temporarily available? e.g.
> doom is running inside.

maybe 'grep doom /dev/wsys/*/label' ?

[-- Attachment #1.2: Type: text/html, Size: 846 bytes --]

[-- Attachment #2: IMG_20161123_132346.jpg --]
[-- Type: image/jpeg, Size: 4801274 bytes --]

[-- Attachment #3: IMG_20161123_132431.jpg --]
[-- Type: image/jpeg, Size: 3613827 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [9fans] How to take a portion of a screenshot
  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
  1 sibling, 1 reply; 20+ messages in thread
From: Steve Simon @ 2016-11-23 21:57 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

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


kudos for the use of m4.

sadly my o2s went the way of ebay years ago, nice machines though.

-Steve


> On 23 Nov 2016, at 21:30, Jules Merit <jules.merit.eurocorp.us@gmail.com> wrote:
> 
> I ported doom, after someone Runed plan9. Trying to get 9front Jurassic Park on MIPS r12k now.
> 
> Also plan9 clearly needs EEG for user defined scheduler and jukebox selection whilst in the labs.
> 
> 
> On Nov 23, 2016 12:57 PM, "Skip Tavakkolian" <9nut@9netics.com> wrote:
> > i have a slightly related question: how do i find out an other
> > window's window id if there is no shell temporarily available? e.g.
> > doom is running inside.
> 
> maybe 'grep doom /dev/wsys/*/label' ?
> 
> 
> 
> <IMG_20161123_132346.jpg>
> <IMG_20161123_132431.jpg>

[-- Attachment #2: Type: text/html, Size: 1513 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [9fans] How to take a portion of a screenshot
  2016-11-23 21:57                     ` Steve Simon
@ 2016-11-23 22:16                       ` Jules Merit
  0 siblings, 0 replies; 20+ messages in thread
From: Jules Merit @ 2016-11-23 22:16 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

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

Thanks I bought one.
/REMdmr

On Nov 23, 2016 1:59 PM, "Steve Simon" <steve@quintile.net> wrote:

>
> kudos for the use of m4.
>
> sadly my o2s went the way of ebay years ago, nice machines though.
>
> -Steve
>
>
> On 23 Nov 2016, at 21:30, Jules Merit <jules.merit.eurocorp.us@gmail.com>
> wrote:
>
> I ported doom, after someone Runed plan9. Trying to get 9front Jurassic
> Park on MIPS r12k now.
>
> Also plan9 clearly needs EEG for user defined scheduler and jukebox
> selection whilst in the labs.
>
> On Nov 23, 2016 12:57 PM, "Skip Tavakkolian" <9nut@9netics.com> wrote:
>
> > i have a slightly related question: how do i find out an other
> > window's window id if there is no shell temporarily available? e.g.
> > doom is running inside.
>
> maybe 'grep doom /dev/wsys/*/label' ?
>
>
>
> <IMG_20161123_132346.jpg>
>
> <IMG_20161123_132431.jpg>
>
>

[-- Attachment #2: Type: text/html, Size: 1901 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-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

* Re: [9fans] How to take a portion of a screenshot
  2016-11-23 21:30                   ` Jules Merit
  2016-11-23 21:57                     ` Steve Simon
@ 2016-11-28  6:30                     ` erik quanstrom
  1 sibling, 0 replies; 20+ messages in thread
From: erik quanstrom @ 2016-11-28  6:30 UTC (permalink / raw)
  To: 9fans

On Wed Nov 23 13:50:02 PST 2016, jules.merit.eurocorp.us@gmail.com wrote:


> I ported doom, after someone Runed plan9. Trying to get 9front Jurassic
> Park on MIPS r12k now.
>
> Also plan9 clearly needs EEG for user defined scheduler and jukebox
> selection whilst in the labs.
>

as soon as i saw the first "dnl", i gave up.

- erik



^ 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).