allow user to set path of the fifo

This commit is contained in:
Leonardo Hernández Hernández 2022-04-18 09:38:07 -05:00 committed by Raphael Robatsch
parent ed1e85d804
commit d072368de0

View file

@ -193,9 +193,15 @@ int main(int argc, char** argv)
strncpy(delim, argv[++i], delimLen); strncpy(delim, argv[++i], delimLen);
else if (!strcmp("-p",argv[i])) else if (!strcmp("-p",argv[i]))
writestatus = pstdout; writestatus = pstdout;
else if (!strcmp("-s",argv[i]))
strcpy(somebarPath, argv[++i]);
} }
strcpy(somebarPath, getenv("XDG_RUNTIME_DIR"));
strcat(somebarPath, "/somebar-0"); if (!strlen(somebarPath)) {
strcpy(somebarPath, getenv("XDG_RUNTIME_DIR"));
strcat(somebarPath, "/somebar-0");
}
delimLen = MIN(delimLen, strlen(delim)); delimLen = MIN(delimLen, strlen(delim));
delim[delimLen++] = '\0'; delim[delimLen++] = '\0';
signal(SIGTERM, termhandler); signal(SIGTERM, termhandler);