9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Rio windows size and location
@ 2008-07-04 13:00 Gregory Pavelcak
  2008-07-04 15:49 ` Russ Cox
  0 siblings, 1 reply; 5+ messages in thread
From: Gregory Pavelcak @ 2008-07-04 13:00 UTC (permalink / raw)
  To: 9fans

Here's the summary for the window command in the man page.

	window [ -m ] [ -r minx miny maxx maxy ] [ -dx n ] [ -dy n ]
          [ -minx n ] [ -miny n ] [ -maxx n ] [ -maxy n ] [ -cd dir ]
          [ -hide ] [ -scroll ] [ -noscroll ] [ cmd arg ... ]

If I do

	window -r 200 200 1000 900,

I get the same result as

	window -minx 200 -miny 200 -maxx 1000 -maxy 900,

which, frankly, believe it or not, was not what I expected.  Given
that -r allows one to specify the exact corners of the window, the
result I expected, and would like, from the second form is just to
create a rectangle on the screen, smaller than the screen size, to
which the new window that opens is confined.  So, my thought was every
time I execute the first form, I get a new window of that exact size
and location right on top of its predecessor, while repeated
executions of the second form give me new windows of the default
(600x400?) size but contained within the bounding box defined by me.

The reason this came up is that I have a wide monitor, and I find
myself moving windows to the center (as if it's a chore to look to one
side or the other!?), so I decided to open clock, winwatch, stats along
the right side of my screen (about 1520,0,1680,1000) and open new
windows with the restriction -maxx 1520.  For example, "window -dx 800
-dy 800 -maxx 1520" means give me a window that size anywhere you want
as long as it doesn't go farther right than 1520.  But, as I've
already suggested, that command doesn't have the expected effect.
Actually, just clicking on the window command I wrote resulted
in this window (from wloc): "window -r 112 112 912 512".

Anyway, the point is I started looking at wctl.c to see if I could get
the behavior I want.  I just thought I would ask if this is a stupid
idea; or if it has already been done, and there's a way to get the
effect I want that I'm missing.

Thanks.

Greg



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

* Re: [9fans] Rio windows size and location
  2008-07-04 13:00 [9fans] Rio windows size and location Gregory Pavelcak
@ 2008-07-04 15:49 ` Russ Cox
  0 siblings, 0 replies; 5+ messages in thread
From: Russ Cox @ 2008-07-04 15:49 UTC (permalink / raw)
  To: 9fans

Rather than fiddle with rio's guts, you'd do better
to implement your own window command that
surveys the screen size
(cat /dev/draw/new >[2]/dev/null | awk '{print $7, $8}')
the locations of current windows (wloc)
and then implements any algorithm you like for
placing windows.

Russ



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

* Re: [9fans] Rio windows size and location
  2008-07-04 13:47 Gregory Pavelcak
@ 2008-07-04 13:49 ` erik quanstrom
  0 siblings, 0 replies; 5+ messages in thread
From: erik quanstrom @ 2008-07-04 13:49 UTC (permalink / raw)
  To: 9fans

> I know that this self-conversation is getting silly, but I thought
> I would report that, as far as just starting a new rio, the winwatch
> that I'm trying to keep uncovered doesn't show windows opened
> in the new rio, sort of defeating the purpose. So, I guess I'm
> back to the original question.
>
> Now, I promise not to post again for at least 24 hours or until someone
> replies with a question directed to me!

i'm not quite sure i follow what you are doing, but the screen file has the
dimentions of the entire screen.  so i think you have all the information
you require.

it wouldn't be hard to clone window and replace it with your special
window creator that does a bit of layout calculation to your
specifications and then emits standard window commands which could be
piped to rc.

- erik




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

* Re: [9fans] Rio windows size and location
@ 2008-07-04 13:47 Gregory Pavelcak
  2008-07-04 13:49 ` erik quanstrom
  0 siblings, 1 reply; 5+ messages in thread
From: Gregory Pavelcak @ 2008-07-04 13:47 UTC (permalink / raw)
  To: 9fans

I know that this self-conversation is getting silly, but I thought
I would report that, as far as just starting a new rio, the winwatch
that I'm trying to keep uncovered doesn't show windows opened
in the new rio, sort of defeating the purpose. So, I guess I'm
back to the original question.

Now, I promise not to post again for at least 24 hours or until someone
replies with a question directed to me!

Greg



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

* [9fans] Rio windows size and location
@ 2008-07-04 13:05 Gregory Pavelcak
  0 siblings, 0 replies; 5+ messages in thread
From: Gregory Pavelcak @ 2008-07-04 13:05 UTC (permalink / raw)
  To: 9fans

Sorry for the self follow-up, but it did just occur
to me that a simple solution is to start a new instance
of rio within a window withe the boundaries I want,
then, obviously, all subsequent window-openings
will take place in there.

D'oh.

Greg



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

end of thread, other threads:[~2008-07-04 15:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-04 13:00 [9fans] Rio windows size and location Gregory Pavelcak
2008-07-04 15:49 ` Russ Cox
2008-07-04 13:05 Gregory Pavelcak
2008-07-04 13:47 Gregory Pavelcak
2008-07-04 13:49 ` erik quanstrom

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