~ft/gemnine

e8d5a68215de837b1dcef223fbcfbeeb70c2e3e8 — Sigrid Haflínudóttir 2 years ago 248f28e
remove "prev url" and add info on history to the readme
2 files changed, 17 insertions(+), 8 deletions(-)

M README.md
M main.c
M README.md => README.md +16 -1
@@ 20,7 20,8 @@ filesystem like `webfs`.

## Installation

Clone the repo, `mk install`. Add a plumb rule to `$home/lib/plumbing`:
Clone the repo, `mk install`. Add a plumb rule to `$home/lib/plumbing`
right before `include basic` line:

```
type	is	text


@@ 28,3 29,17 @@ data	matches	'gemini://[^ ]+'
plumb	to	gemini
plumb	client	window gemnine -w $0
```

Then updated the current rules:

```
cp $home/lib/plumbing /mnt/plumb/rules
```

## Link history

While browsing, one might want to have a separate window with all the links followed:

```
while(){ syscall -o read 0 buf 512 </mnt/plumb/gemini >[2]/dev/null | tail -1 }
```

M main.c => main.c +1 -7
@@ 298,7 298,7 @@ void
main(int argc, char **argv)
{
	Response *r;
	char *s, *t, *u, *url, *prevurl;
	char *s, *t, *u, *url;
	int len, wait, pl, fd;
	Plumbmsg *m;
	Biobuf out, body;


@@ 319,7 319,6 @@ main(int argc, char **argv)
	quotefmtinstall();
	Binit(&out, 1, OWRITE);
	pl = -1;
	prevurl = nil;

nexturl:
	url = nil;


@@ 388,10 387,6 @@ nextreq:
				}
				free(s);
			}
			if(prevurl != nil){
				Bprint(&out, "\nPrevious: %s\n", prevurl);
				free(prevurl);
			}
		}
		freeresponse(r);
	}else{


@@ 401,7 396,6 @@ nextreq:
	}

	Bflush(&out);
	prevurl = url;
	if(wait)
		goto nexturl;