Numerous fixes and changes
[pandora-libraries.git] / lib / pnd_desktop.c
index b5b9a40..3bb3066 100644 (file)
@@ -84,14 +84,21 @@ unsigned char pnd_emit_dotdesktop ( char *targetpath, char *pndrun, pnd_disco_t
 #endif
 
   if ( p -> exec ) {
+    char *nohup;
+
+    if ( p -> option_no_x11 ) {
+      nohup = "/usr/bin/nohup ";
+    } else {
+      nohup = "";
+    }
 
     // basics
     if ( p -> object_type == pnd_object_type_directory ) {
-      snprintf ( buffer, 1020, "Exec=/usr/bin/nohup %s -p %s -e %s -b %s",
-                pndrun, p -> object_path, p -> exec, p -> unique_id );
+      snprintf ( buffer, 1020, "Exec=%s%s -p %s -e %s -b %s",
+                nohup, pndrun, p -> object_path, p -> exec, p -> unique_id );
     } else if ( p -> object_type == pnd_object_type_pnd ) {
-      snprintf ( buffer, 1020, "Exec=/usr/bin/nohup %s -p %s/%s -e %s -b %s",
-                pndrun, p -> object_path, p -> object_filename, p -> exec, p -> unique_id );
+      snprintf ( buffer, 1020, "Exec=%s%s -p %s/%s -e %s -b %s",
+                nohup, pndrun, p -> object_path, p -> object_filename, p -> exec, p -> unique_id );
     }
 
     // start dir