diff options
author | Leonardo Hernández Hernández <leohdz172@protonmail.com> | 2022-04-18 09:38:07 -0500 |
---|---|---|
committer | Raphael Robatsch <raphael-git@tapesoftware.net> | 2022-04-19 08:49:11 +0200 |
commit | d072368de029458b9410591bdd257471389a26f9 (patch) | |
tree | 826c2d4b2880d2d4346937f034aedadcc584411c | |
parent | ed1e85d804242dca7feec6ef493d60051822498b (diff) |
allow user to set path of the fifo
-rw-r--r-- | someblocks.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/someblocks.c b/someblocks.c index 3530de6..8103164 100644 --- a/someblocks.c +++ b/someblocks.c @@ -193,9 +193,15 @@ int main(int argc, char** argv) strncpy(delim, argv[++i], delimLen); else if (!strcmp("-p",argv[i])) 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)); delim[delimLen++] = '\0'; signal(SIGTERM, termhandler); |