]> git.sur5r.net Git - i3/i3/commitdiff
Use DISPLAY in XKB-code
authorAxel Wagner <mail@merovius.de>
Mon, 14 Mar 2011 08:20:16 +0000 (09:20 +0100)
committerAxel Wagner <mail@merovius.de>
Mon, 14 Mar 2011 08:20:16 +0000 (09:20 +0100)
i3bar/src/xcb.c

index 8d4f60b5d4ee14d81bdd9708f85af609c9806a28..a7f1e51b4c114695f6c98c40465d4d9e42033384 100644 (file)
@@ -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,