From: Axel Wagner Date: Mon, 14 Mar 2011 08:20:16 +0000 (+0100) Subject: Use DISPLAY in XKB-code X-Git-Tag: 4.0.1~7^2~3^2~23 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7fb6258fbd9246e6983f508c44d84d63aa7ce7d1;p=i3%2Fi3 Use DISPLAY in XKB-code --- 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,