mothra: use aux/statusmsg to display download window, add aux/statusmsg to mkfile
This commit is contained in:
parent
e283619ecb
commit
b9ff604c31
2 changed files with 9 additions and 17 deletions
|
@ -33,6 +33,7 @@ TARG=\
|
||||||
searchfs\
|
searchfs\
|
||||||
seek\
|
seek\
|
||||||
statusbar\
|
statusbar\
|
||||||
|
statusmsg\
|
||||||
stub\
|
stub\
|
||||||
tablet\
|
tablet\
|
||||||
timesync\
|
timesync\
|
||||||
|
|
|
@ -265,6 +265,8 @@ void main(int argc, char *argv[]){
|
||||||
char *url;
|
char *url;
|
||||||
int errfile;
|
int errfile;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
quotefmtinstall();
|
||||||
ARGBEGIN{
|
ARGBEGIN{
|
||||||
case 'd': debug++; break;
|
case 'd': debug++; break;
|
||||||
case 'v': verbose=1; break;
|
case 'v': verbose=1; break;
|
||||||
|
@ -551,7 +553,7 @@ char *arg(char *s){
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
void save(int ifd, char *name){
|
void save(int ifd, char *name){
|
||||||
char buf[NNAME];
|
char buf[NNAME+64];
|
||||||
int cfd, ofd;
|
int cfd, ofd;
|
||||||
if(ifd < 0){
|
if(ifd < 0){
|
||||||
message("save: %s: %r", name);
|
message("save: %s: %r", name);
|
||||||
|
@ -571,22 +573,11 @@ void save(int ifd, char *name){
|
||||||
close(ifd);
|
close(ifd);
|
||||||
dup(ofd, 1);
|
dup(ofd, 1);
|
||||||
close(ofd);
|
close(ofd);
|
||||||
snprint(buf, sizeof(buf), "-pid %d", getpid());
|
|
||||||
if(newwindow(buf) != -1){
|
snprint(buf, sizeof(buf),
|
||||||
close(2); open("/dev/cons", OWRITE);
|
"{tput -p || cat} |[2] {aux/statusmsg -k %q >/dev/null || cat >/dev/null}", name);
|
||||||
if((cfd = open("/dev/label", OWRITE)) >= 0){
|
execl("/bin/rc", "rc", "-c", buf, nil);
|
||||||
fprint(cfd, "save %s", name);
|
exits("exec");
|
||||||
close(cfd);
|
|
||||||
}
|
|
||||||
if((cfd = open("/dev/wctl", OWRITE)) >= 0){
|
|
||||||
fprint(cfd, "scroll\n");
|
|
||||||
close(cfd);
|
|
||||||
}
|
|
||||||
fprint(2, "save %s...\n", name);
|
|
||||||
execl("/bin/tput", "tput", "-p", nil);
|
|
||||||
}
|
|
||||||
execl("/bin/cat", "cat", nil);
|
|
||||||
exits(0);
|
|
||||||
}
|
}
|
||||||
close(ifd);
|
close(ifd);
|
||||||
close(ofd);
|
close(ofd);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue