From 2e012d533e49c55c79f808fa213e91d15fb64568 Mon Sep 17 00:00:00 2001 From: Aaron Marcher Date: Sat, 17 Sep 2016 16:53:45 +0200 Subject: only open and close display if output type is dwm --- slstatus.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/slstatus.c b/slstatus.c index e1d271f..379be53 100644 --- a/slstatus.c +++ b/slstatus.c @@ -633,7 +633,9 @@ main(int argc, char *argv[]) sigaction(SIGINT, &act, 0); sigaction(SIGTERM, &act, 0); - dpy = XOpenDisplay(NULL); + if (!oflag) { + dpy = XOpenDisplay(NULL); + } while (!done) { status_string[0] = '\0'; @@ -671,9 +673,8 @@ main(int argc, char *argv[]) if (!oflag) { set_status(NULL); + XCloseDisplay(dpy); } - XCloseDisplay(dpy); - return 0; } -- cgit v1.2.3