Some X apps and window managers accept a "-display" command line 
option. Some use "--display". All appear to honor the DISPLAY 
environmental variable.

This bit me some time ago with the Debian menu system, which 
facilitates changing window managers on-the-fly. Switching to 
e went horribly wrong because it didn't know what DISPLAY to use.

There may be a better way to do this, but no one has complained
in the couple of years that I've carried the patch.
--- enlightenment-0.16.6-upstream/src/session.c 2003-11-05 12:58:51.000000000 -0500
+++ enlightenment-0.16.6-debian/src/session.c   2003-11-06 05:07:03.000000000 -0500
@@ -1196,7 +1196,7 @@
 #endif
        XCloseDisplay(disp);
        disp = NULL;
-       Esnprintf(s, sizeof(s), "exec %s -display %s", atword(params, 2), dstr);
+       Esnprintf(s, sizeof(s), "DISPLAY=%s exec %s", dstr, atword(params, 2));
        execl(DEFAULT_SH_PATH, DEFAULT_SH_PATH, "-c", s, NULL);
      }
    else if (!strcmp(s, "restart"))

Reply via email to