~amavect/pal

e00c44539f9cbc2af512026098d2641566a69887 — amavect 4 years ago b50a3c3
send on makeu send, init makeu with first color
1 files changed, 8 insertions(+), 1 deletions(-)

M pal.c
M pal.c => pal.c +8 -1
@@ 206,7 206,12 @@ initpicker(void)
	int wfd;
	char *srvwsys;
	Channel *c;
	char s[11];
	
	if(ncolors > 0)
		snprint(s, sizeof(s), "0x%08ulX", colors[selcol]);
	else
		snprint(s, sizeof(s), "0xFFFFFFFF");
	if(pipe(fd) < 0)
		error("cannot pipe");
	pid = rfork(RFPROC|RFNOWAIT|RFNAMEG|RFFDG|RFREND);


@@ 227,7 232,7 @@ initpicker(void)
			error("can't open $wsys");
		if(mount(wfd, -1, "/dev", MBEFORE, "new -dx 600 -dy 400") < 0)
			error("can't mount new window");
		if(execl("/bin/makeu", "/bin/makeu", "-pi", nil) < 0)
		if(execl("/bin/makeu", "/bin/makeu", "-pi", "-c", s, nil) < 0)
			error("can't exec");
	}
	close(fd[1]);


@@ 367,6 372,8 @@ threadmain(int argc, char **argv)
		case PICKER:
			if(ncolors > 0){
				colors[selcol] = col;
				if(iflag)
					sendcolor();
				redraw();
			}
			break;