only open and close display if output type is dwm

This commit is contained in:
Aaron Marcher 2016-09-17 16:53:45 +02:00 committed by Aaron Marcher (drkhsh)
parent 4dcba6b7e8
commit 2e012d533e

View file

@ -633,7 +633,9 @@ main(int argc, char *argv[])
sigaction(SIGINT, &act, 0); sigaction(SIGINT, &act, 0);
sigaction(SIGTERM, &act, 0); sigaction(SIGTERM, &act, 0);
if (!oflag) {
dpy = XOpenDisplay(NULL); dpy = XOpenDisplay(NULL);
}
while (!done) { while (!done) {
status_string[0] = '\0'; status_string[0] = '\0';
@ -671,9 +673,8 @@ main(int argc, char *argv[])
if (!oflag) { if (!oflag) {
set_status(NULL); set_status(NULL);
}
XCloseDisplay(dpy); XCloseDisplay(dpy);
}
return 0; return 0;
} }