diff options
-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); |