- if (send(new_fd, "Hello, world!", 13, 0) == -1)
- perror("send");
- close(new_fd);
+ char buf[4096];
+ if (recv(activefd, buf, 99, 0) == -1) {
+ perror("recv");
+ exit(1);
+ }
+ buf[4096] = '\0';
+ printf("irssi-notify: recieved '%s'\n", buf);
+ if (!fork()){
+ setenv("DISPLAY", ":0", 1); // doesn't seem to be doing the trick
+ execlp("notify-display",
+ "notify-display", buf, NULL);
+ // the first argument to execl is the command, the second is the first argument
+ // passed to the program ($0), customarily the evocation of the command
+ }
+ close(activefd);