mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-12 16:52:10 -04:00
launcher: allow terminal apps
This commit is contained in:
@@ -170,26 +170,35 @@ Singleton {
|
||||
const userPrefix = SettingsData.launchPrefix?.trim() || "";
|
||||
const defaultPrefix = Quickshell.env("DMS_DEFAULT_LAUNCH_PREFIX") || "";
|
||||
const prefix = userPrefix.length > 0 ? userPrefix : defaultPrefix;
|
||||
const workDir = desktopEntry.workingDirectory || Quickshell.env("HOME");
|
||||
const escapedCmd = cmd.map(arg => escapeShellArg(arg)).join(" ");
|
||||
const shellCmd = prefix.length > 0 ? `${prefix} ${escapedCmd}` : escapedCmd;
|
||||
|
||||
if (desktopEntry.runInTerminal) {
|
||||
const terminal = Quickshell.env("TERMINAL") || "xterm";
|
||||
Quickshell.execDetached({
|
||||
command: [terminal, "-e", "sh", "-c", shellCmd],
|
||||
workingDirectory: workDir
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (prefix.length > 0 && needsShellExecution(prefix)) {
|
||||
const escapedCmd = cmd.map(arg => escapeShellArg(arg)).join(" ");
|
||||
const shellCmd = `${prefix} ${escapedCmd}`;
|
||||
|
||||
Quickshell.execDetached({
|
||||
command: ["sh", "-c", shellCmd],
|
||||
workingDirectory: desktopEntry.workingDirectory || Quickshell.env("HOME")
|
||||
});
|
||||
} else {
|
||||
if (prefix.length > 0) {
|
||||
const launchPrefix = prefix.split(" ");
|
||||
cmd = launchPrefix.concat(cmd);
|
||||
}
|
||||
|
||||
Quickshell.execDetached({
|
||||
command: cmd,
|
||||
workingDirectory: desktopEntry.workingDirectory || Quickshell.env("HOME")
|
||||
workingDirectory: workDir
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (prefix.length > 0) {
|
||||
cmd = prefix.split(" ").concat(cmd);
|
||||
}
|
||||
|
||||
Quickshell.execDetached({
|
||||
command: cmd,
|
||||
workingDirectory: workDir
|
||||
});
|
||||
}
|
||||
|
||||
function launchDesktopAction(desktopEntry, action, useNvidia) {
|
||||
|
||||
Reference in New Issue
Block a user