Add support for Path in .desktop files

This commit is contained in:
Mike Messmore
2016-11-30 21:21:18 -06:00
parent 48078ffb25
commit d21507cd4b
4 changed files with 13 additions and 1 deletions

View File

@@ -441,6 +441,7 @@ void launcher_action(LauncherIcon *icon, XEvent *evt)
// Allow children to exist after parent destruction
setsid();
// Run the command
chdir(icon->cwd);
execl("/bin/sh", "/bin/sh", "-c", icon->cmd, NULL);
fprintf(stderr, "Failed to execlp %s\n", icon->cmd);
#if HAVE_SN
@@ -507,6 +508,13 @@ void launcher_reload_icon(Launcher *launcher, LauncherIcon *launcherIcon)
if (launcherIcon->cmd)
free(launcherIcon->cmd);
launcherIcon->cmd = strdup(entry.exec);
if (launcherIcon->cwd)
free(launcherIcon->cwd);
if (entry.cwd) {
launcherIcon->cwd = strdup(entry.cwd);
} else {
launcherIcon->cwd = get_current_dir_name();
}
if (launcherIcon->icon_name)
free(launcherIcon->icon_name);
launcherIcon->icon_name = entry.icon ? strdup(entry.icon) : strdup(DEFAULT_ICON);