Changed output to stdout instead of a file

This commit is contained in:
David Donahue 2021-03-01 13:49:29 -06:00
parent 593b7eec3c
commit f5e7caac00

20
dwl.c
View file

@ -2163,16 +2163,8 @@ statusbar(void)
{ {
Monitor *m = NULL; Monitor *m = NULL;
Client *c = NULL; Client *c = NULL;
FILE *taginfo;
char fname[30]="";
unsigned int activetags; unsigned int activetags;
//Add WAYLAND_DISPLAY to filename so each session has a predictable file
snprintf(fname, 30, "/tmp/dwltags-%s", getenv("WAYLAND_DISPLAY"));
if (!(taginfo = fopen(fname, "w")))
return;
wl_list_for_each(m, &mons, link) { wl_list_for_each(m, &mons, link) {
activetags=0; activetags=0;
wl_list_for_each(c, &clients, link) { wl_list_for_each(c, &clients, link) {
@ -2180,15 +2172,15 @@ statusbar(void)
activetags |= c->tags; activetags |= c->tags;
} }
if (focustop(m)) if (focustop(m))
fprintf(taginfo, "%s title %s\n", m->wlr_output->name, client_get_title(focustop(m))); fprintf(stdout, "%s title %s\n", m->wlr_output->name, client_get_title(focustop(m)));
else else
fprintf(taginfo, "%s title \n", m->wlr_output->name); fprintf(stdout, "%s title \n", m->wlr_output->name);
fprintf(taginfo, "%s selmon %u\n", m->wlr_output->name, m == selmon); fprintf(stdout, "%s selmon %u\n", m->wlr_output->name, m == selmon);
fprintf(taginfo, "%s tags %u %u\n", m->wlr_output->name, activetags, m->tagset[m->seltags]); fprintf(stdout, "%s tags %u %u\n", m->wlr_output->name, activetags, m->tagset[m->seltags]);
fprintf(taginfo, "%s layout %s\n", m->wlr_output->name, m->lt[m->sellt]->symbol); fprintf(stdout, "%s layout %s\n", m->wlr_output->name, m->lt[m->sellt]->symbol);
} }
fclose (taginfo); fflush(stdout);
} }
void void