Add support for Path in .desktop files
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user