From 7fb6258fbd9246e6983f508c44d84d63aa7ce7d1 Mon Sep 17 00:00:00 2001 From: Axel Wagner Date: Mon, 14 Mar 2011 09:20:16 +0100 Subject: [PATCH] Use DISPLAY in XKB-code --- i3bar/src/xcb.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/i3bar/src/xcb.c b/i3bar/src/xcb.c index 8d4f60b5..a7f1e51b 100644 --- a/i3bar/src/xcb.c +++ b/i3bar/src/xcb.c @@ -484,7 +484,11 @@ void init_xcb(char *fontname) { xkb_major = XkbMajorVersion; xkb_minor = XkbMinorVersion; - xkb_dpy = XkbOpenDisplay(":0", + char *dispname = getenv("DISPLAY"); + if (dispname == NULL) { + dispname = ":0"; + } + xkb_dpy = XkbOpenDisplay(dispname, &xkb_event_base, &xkb_errbase, &xkb_major, -- 2.39.5