Index: trunk/BNC/src/bncmain.cpp
===================================================================
--- trunk/BNC/src/bncmain.cpp	(revision 4445)
+++ trunk/BNC/src/bncmain.cpp	(revision 4446)
@@ -67,5 +67,5 @@
 int main(int argc, char *argv[]) {
 
-  bool       GUIenabled  = true;
+  bool       interactive  = true;
   QByteArray rawFileName;
   QString    confFileName;
@@ -82,5 +82,5 @@
     }
     if (QRegExp("--?nw").exactMatch(argv[ii])) {
-      GUIenabled = false;
+      interactive = false;
     }
     if (ii + 1 < argc) {
@@ -89,5 +89,5 @@
       }
       if (QRegExp("--?file").exactMatch(argv[ii])) {
-        GUIenabled = false;
+        interactive = false;
         rawFileName = QByteArray(argv[ii+1]);
       }
@@ -96,14 +96,20 @@
 
 #ifdef Q_OS_MAC
-  if (argc== 3 && GUIenabled) {
+  if (argc== 3 && interactive) {
     confFileName = QString(argv[2]);
   }
 #else
-  if (argc == 2 && GUIenabled) {
+  if (argc == 2 && interactive) {
     confFileName = QString(argv[1]);
   }
 #endif
 
-  bncApp app(argc, argv, GUIenabled);
+#ifdef Q_WS_X11
+  bool useGUI = getenv("DISPLAY") != 0;
+#else
+  bool useGUI = true;
+#endif
+ 
+  bncApp app(argc, argv, useGUI);
 
   app.setApplicationName("BNC");
@@ -124,5 +130,5 @@
   // Interactive Mode - open the main window
   // ---------------------------------------
-  if (GUIenabled) {
+  if (interactive) {
 
     app.setMode(bncApp::interactive);
