Sanitize error when trying to run GUI without XIndex: lshw-02.14/src/gui/integration/console.apps
===================================================================
Index: lshw/src/gui/integration/console.apps
===================================================================
--- lshw.orig/src/gui/integration/console.apps
+++ lshw/src/gui/integration/console.apps
@@ -1,3 +1,3 @@
 USER=root
-PROGRAM=/usr/sbin/gtk-lshw
+PROGRAM=/usr/sbin/lshw-gtk
 SESSION=true
Index: lshw/src/gui/integration/gtk-lshw.desktop
===================================================================
--- lshw.orig/src/gui/integration/gtk-lshw.desktop
+++ lshw/src/gui/integration/gtk-lshw.desktop
@@ -5,7 +5,7 @@ Comment[fr]=Listeur de matériel
 Comment[es]=Listar equipamiento
 Categories=Application;System;X-Red-Hat-Base;X-Fedora;
 Icon=/usr/share/lshw/artwork/logo.svg
-Exec=/usr/bin/gtk-lshw
+Exec=/usr/bin/lshw-gtk
 Type=Application
 Terminal=false
 Encoding=UTF-8
Index: lshw/src/lshw.cc
===================================================================
--- lshw.orig/src/lshw.cc
+++ lshw/src/lshw.cc
@@ -11,6 +11,7 @@
 #include <string.h>
 #include <stdlib.h>
 #include <iostream>
+#include <errno.h>
 
 #ifndef NONLS
 #include <locale.h>
@@ -31,8 +32,8 @@ void usage(const char *progname)
   fprintf(stderr, _("\t-json           output hardware tree as a JSON object\n"));
   fprintf(stderr, _("\t-short          output hardware paths\n"));
   fprintf(stderr, _("\t-businfo        output bus information\n"));
-  if(getenv("DISPLAY") && exists(SBINDIR"/gtk-lshw"))
-    fprintf(stderr, _("\t-X              use graphical interface\n"));
+  if(getenv("DISPLAY") && exists(SBINDIR"/lshw-gtk"))
+      fprintf(stderr, _("\t-X              use graphical interface\n"));
   fprintf(stderr, _("\noptions can be\n"));
 #ifdef SQLITE
   fprintf(stderr, _("\t-dump filename  display output and dump collected information into a file (SQLite database)\n"));
@@ -221,7 +222,19 @@ char **argv)
     exit(1);
   }
 
-  if(enabled("output:X")) execl(SBINDIR"/gtk-lshw", SBINDIR"/gtk-lshw", NULL);
+/*  if(enabled("output:X")) execl(SBINDIR"/gtk-lshw", SBINDIR"/gtk-lshw", NULL); */
+
+  if(enabled("output:X")) {
+        execl(SBINDIR"/lshw-gtk", SBINDIR"/lshw-gtk", NULL);                                                                                                                                                    
+        // Execl only returns if an error has occurred.
+        if ( errno == ENOENT ) {
+             fprintf(stderr, "ERROR: Sorry, cannot run the X11/GTK interface because %s/lshw-gtk\n is not available.\n", SBINDIR);                                                                               
+             fprintf(stderr, "HINT: Install the lshw-gtk package in Debian.\n");                                                                                                                                 
+        } else {
+             fprintf(stderr, "ERROR: There was an error when trying to execute %s/lshw-gtk: %s\n", SBINDIR, strerror(errno));                                                                                    
+             fprintf(stderr, "Will just print the information on screen\n");                                                                                                                                     
+        }
+  }
 
   if (geteuid() != 0)
   {
