#define PND_DOTDESKTOP_DEFAULT "/usr/share/applications"
// apps
-#define PND_DEFAULT_WORKDIR "/tmp"
+#define PND_DEFAULT_WORKDIR "./"
/* pnd_apps_exec() is used to blindly launch an app, be it a .pnd file bundle or a plain executable
* (shell, bin, whatever.) pndrun specifies the full path to the pnd_run sh script, which should be
}
#endif
-#if 0
+#if 0 // we let pnd_run.sh handle this
if ( p -> startdir ) {
snprintf ( buffer, 1020, "Path=%s\n", p -> startdir );
fprintf ( f, "%s", buffer );
#endif
if ( p -> exec ) {
+
+ // basics
if ( p -> object_type == pnd_object_type_directory ) {
- snprintf ( buffer, 1020, "Exec=%s -p %s -e %s -u\n", pndrun, p -> object_path, p -> exec );
+ snprintf ( buffer, 1020, "Exec=%s -p %s -e %s -u", pndrun, p -> object_path, p -> exec );
} else if ( p -> object_type == pnd_object_type_pnd ) {
- snprintf ( buffer, 1020, "Exec=%s -p %s/%s -e %s -u\n", pndrun, p -> object_path, p -> object_filename, p -> exec );
+ snprintf ( buffer, 1020, "Exec=%s -p %s/%s -e %s -u", pndrun, p -> object_path, p -> object_filename, p -> exec );
+ }
+
+ // start dir
+ if ( p -> startdir ) {
+ strncat ( buffer, " -s ", 1020 );
+ strncat ( buffer, p -> startdir, 1020 );
}
+
+ // newline
+ strncat ( buffer, "\n", 1020 );
+
+ // emit
fprintf ( f, "%s", buffer );
}