9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Abaco's Web Page Name in winwatch
@ 2007-07-02 15:56 Gregory Pavelcak
  2007-07-02 16:05 ` David Leimbach
  2007-07-02 16:15 ` erik quanstrom
  0 siblings, 2 replies; 5+ messages in thread
From: Gregory Pavelcak @ 2007-07-02 15:56 UTC (permalink / raw)
  To: 9fans

I realize that abaco manages multiple web pages itself,
but, for reasons I won't go into, I generally launch a new
small abaco window for each web page. To help this style
of usage along, I've been trying to incorporate writing
to /dev/label into the abaco code. I took this bit

	int fd;
	fd = open("/dev/label", OWRITE);
	if(fd >= 0) {
		write(fd, title, strlen((char *)title));
		close(fd);
	}

from plan9.c in links-varfont since links exhibits the
behavior I'm looking for. I've tried using this substituting
various combinations of w->tag, w->page.title, &w->tag,
&w->page.title etc. for "title" and putting the lot into
winsettag1 in abaco/wind.c with no luck (In most cases,
either the build fails with prototype mismatch, or the
build is successful, but I only get an apparently unrelated
character or two in winwatch).

The usual I'm-no-programmer-apologies etc. etc.

Thanks for any help moving this small customization along.

Greg



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

* Re: [9fans] Abaco's Web Page Name in winwatch
  2007-07-02 15:56 [9fans] Abaco's Web Page Name in winwatch Gregory Pavelcak
@ 2007-07-02 16:05 ` David Leimbach
  2007-07-02 16:14   ` Gregory Pavelcak
  2007-07-02 16:15 ` erik quanstrom
  1 sibling, 1 reply; 5+ messages in thread
From: David Leimbach @ 2007-07-02 16:05 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

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

I use winwatch with my plan 9 box (when it's running) to manage something
like virtual desktops with sub-rio sessions.  Winwatch actually helps me
manage the sub-rio's.
I just have a bunch of rc scripts edit /dev/label via echo etc.  I don't
bother with C coding unless I absolutely have to on Plan 9.

Dave

On 7/2/07, Gregory Pavelcak <g.pavelcak@comcast.net> wrote:
>
> I realize that abaco manages multiple web pages itself,
> but, for reasons I won't go into, I generally launch a new
> small abaco window for each web page. To help this style
> of usage along, I've been trying to incorporate writing
> to /dev/label into the abaco code. I took this bit
>
>         int fd;
>         fd = open("/dev/label", OWRITE);
>         if(fd >= 0) {
>                 write(fd, title, strlen((char *)title));
>                 close(fd);
>         }
>
> from plan9.c in links-varfont since links exhibits the
> behavior I'm looking for. I've tried using this substituting
> various combinations of w->tag, w->page.title, &w->tag,
> &w->page.title etc. for "title" and putting the lot into
> winsettag1 in abaco/wind.c with no luck (In most cases,
> either the build fails with prototype mismatch, or the
> build is successful, but I only get an apparently unrelated
> character or two in winwatch).
>
> The usual I'm-no-programmer-apologies etc. etc.
>
> Thanks for any help moving this small customization along.
>
> Greg
>
>


-- 
- Passage Matthew 5:37:
   But let your communication be, Yea, yea; Nay, nay: for whatsoever is more
than these cometh of evil.

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

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

* Re: [9fans] Abaco's Web Page Name in winwatch
  2007-07-02 16:05 ` David Leimbach
@ 2007-07-02 16:14   ` Gregory Pavelcak
  0 siblings, 0 replies; 5+ messages in thread
From: Gregory Pavelcak @ 2007-07-02 16:14 UTC (permalink / raw)
  To: 9fans

I had some success with echoing to /dev/label from the
plumber, but timing seems to be an issue. If I don't bind
/dev/null /dev/label, I end up with winwatch showing "abaco".
If I do, I get the web page name in winwatch for new windows
but not when I open a new link within a window.

Perhaps I just need to think harder about how to do this
with rc. I'm certainly not opposed to that approach. Any
suggestions along these lines will be greatly appreciated
as well.

Greg

> I use winwatch with my plan 9 box (when it's running) to manage something
> like virtual desktops with sub-rio sessions.  Winwatch actually helps me
> manage the sub-rio's.
> I just have a bunch of rc scripts edit /dev/label via echo etc.  I don't
> bother with C coding unless I absolutely have to on Plan 9.
> 
> Dave
> 
> 
> 
> -- 
> - Passage Matthew 5:37:
>    But let your communication be, Yea, yea; Nay, nay: for whatsoever is more
> than these cometh of evil.



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

* Re: [9fans] Abaco's Web Page Name in winwatch
  2007-07-02 15:56 [9fans] Abaco's Web Page Name in winwatch Gregory Pavelcak
  2007-07-02 16:05 ` David Leimbach
@ 2007-07-02 16:15 ` erik quanstrom
  2007-07-02 16:37   ` Gregory Pavelcak
  1 sibling, 1 reply; 5+ messages in thread
From: erik quanstrom @ 2007-07-02 16:15 UTC (permalink / raw)
  To: 9fans

label is a Runestr, not a char*.  what you want is

void
updlabel(void)
{
	int fd, n;

	fd = open("/dev/label", OWRITE);
	if(fd == -1)
		return;
	fprint(fd, "%#.*S", title.nr, title.r);
	close(fd);
}

- erik


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

* Re: [9fans] Abaco's Web Page Name in winwatch
  2007-07-02 16:15 ` erik quanstrom
@ 2007-07-02 16:37   ` Gregory Pavelcak
  0 siblings, 0 replies; 5+ messages in thread
From: Gregory Pavelcak @ 2007-07-02 16:37 UTC (permalink / raw)
  To: 9fans

Thanks.

That's much nicer than what I was doing with the plumber.  It not only
updates winwatch with a new name when I stay within a single window,
but the page names, like "Plan 9 from Bell Labs" are nicer than the
plumber's argument "http://cm.bell-labs.com/plan9/".

Greg

> label is a Runestr, not a char*.  what you want is
> 
> void
> updlabel(void)
> {
> 	int fd, n;
> 
> 	fd = open("/dev/label", OWRITE);
> 	if(fd == -1)
> 		return;
> 	fprint(fd, "%#.*S", title.nr, title.r);
> 	close(fd);
> }
> 
> - erik



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

end of thread, other threads:[~2007-07-02 16:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-02 15:56 [9fans] Abaco's Web Page Name in winwatch Gregory Pavelcak
2007-07-02 16:05 ` David Leimbach
2007-07-02 16:14   ` Gregory Pavelcak
2007-07-02 16:15 ` erik quanstrom
2007-07-02 16:37   ` Gregory Pavelcak

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