I haven't tried this (yet), since I am no longer familiar with BASIC (like alone BaCon) but after a quick look at the syntax I think 'something' like the following modification to mk-jwm.main.bac should add the xterm -e only when specified in desktop file. The only change (2 or 3 lines of code) is the use of variable termi$ and an extra CASE followed by concatenation in exe$. Most of the following is identical to original lines 35 onwards in the source:
Code: Select all
'##### LOOP: Make raw menu.
FOR i = 0 TO DtSz-1
name$ = "" : genname$ = ""
exe$ = "" : ico$ = "" : cat$ = "" : termi$ = ""
'### This assumes the "Exec=" line has ONLY [/path/]file, no extra crap.
OPEN DT$[i] FOR READING AS file_
WHILE NOT(ENDFILE(file_)) DO
IF ENDFILE(file_) THEN BREAK
READLN txt$ FROM file_
sep = INSTR(txt$, "=")
Var$ = MID$(txt$, sep+1)
SELECT LEFT$(txt$, sep)
CASE "Name=" : name$ = Var$
CASE "GenericName=" : genname$ = Var$
CASE "Terminal=" : IF Var$ = "true" THEN termi$ = "xterm -e "
CASE "Exec="
exe$ = termi$ & Var$
termi$ = ""
CASE "Icon=" : ico$ = Var$
Also, the hard-coded 'xterm -e' above wouldn't be the best either.
If I can get it working I'll let you know anyway.
William
EDIT2: I'm sure Terry could fix this in ten seconds...
EDIT3: I note that /usr/share/applications dir is hardcoded in existing implementation.
EDIT4: Instead of hardcoding xterm -e above should, if possible, use default terminal command really (in case some other terminal rather than xterm is installed). That may be tricky though since other terminals may use different option that -e to run executables.