Don't manually strip dzen-formats.
Instead "output_format = none" should be used in the i3status-config
This commit is contained in:
parent
14b885adf1
commit
bef80146e6
|
@ -37,38 +37,8 @@ void cleanup() {
|
|||
}
|
||||
|
||||
/*
|
||||
* Since we don't use colors and stuff, we strip the dzen-formatstrings
|
||||
*
|
||||
*/
|
||||
void strip_dzen_formats(char *buffer) {
|
||||
char *src = buffer;
|
||||
char *dest = buffer;
|
||||
while (*src != '\0') {
|
||||
/* ^ starts a format-string, ) ends it */
|
||||
if (*src == '^') {
|
||||
/* We replace the seperators from i3status by pipe-symbols */
|
||||
if (!strncmp(src, "^ro", strlen("^ro"))) {
|
||||
*(dest++) = ' ';
|
||||
*(dest++) = '|';
|
||||
*(dest++) = ' ';
|
||||
}
|
||||
while (*src != ')') {
|
||||
src++;
|
||||
}
|
||||
src++;
|
||||
} else {
|
||||
*dest = *src;
|
||||
src++;
|
||||
dest++;
|
||||
}
|
||||
}
|
||||
/* The last character is \n, which xcb cannot display */
|
||||
*(--dest) = '\0';
|
||||
}
|
||||
|
||||
/*
|
||||
* Callbalk for stdin. We read a line from stdin, strip dzen-formats and store
|
||||
* the result in statusline
|
||||
* Callbalk for stdin. We read a line from stdin and store the result
|
||||
* in statusline
|
||||
*
|
||||
*/
|
||||
void stdin_io_cb(struct ev_loop *loop, ev_io *watcher, int revents) {
|
||||
|
@ -105,7 +75,6 @@ void stdin_io_cb(struct ev_loop *loop, ev_io *watcher, int revents) {
|
|||
FREE(buffer);
|
||||
return;
|
||||
}
|
||||
strip_dzen_formats(buffer);
|
||||
FREE(statusline);
|
||||
statusline = buffer;
|
||||
printf("%s\n", buffer);
|
||||
|
|
Loading…
Reference in New Issue