Skip to content

Commit abc2662

Browse files
committed
fix for apps defined in desktop files that must be run in a particular directory
1 parent a14f22b commit abc2662

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

menubuilder.lua

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ end
456456

457457

458458
function LoadDesktopFile(path)
459-
local S, str, toks, invoke, exec, config
459+
local S, str, toks, invoke, exec, config, run_dir
460460

461461
S=stream.STREAM(path)
462462
if S ~= nil
@@ -465,7 +465,13 @@ then
465465
config=dataparser.PARSER("config", str)
466466
if config
467467
then
468+
run_dir=strutil.stripQuotes(config:value("Path"))
469+
if strutil.strlen(run_dir) > 0
470+
then
471+
invoke="cd " .. run_dir .. "; exec " .. strutil.stripQuotes(config:value("Exec"))
472+
else
468473
invoke=strutil.stripQuotes(config:value("Exec"))
474+
end
469475
toks=strutil.TOKENIZER(invoke, " ")
470476
exec=toks:next()
471477

0 commit comments

Comments
 (0)