feat: spawn application process via compositor

This commit is contained in:
wxlyyy
2026-02-02 00:37:22 +08:00
parent 7fef627415
commit c095b78ef4
8 changed files with 73 additions and 8 deletions
+11 -3
View File
@@ -6,6 +6,7 @@ import Quickshell
import Quickshell.Wayland
import Quickshell.Widgets
import qs.Commons
import qs.Services.Compositor
import qs.Services.System
import qs.Services.UI
import qs.Widgets
@@ -1054,13 +1055,20 @@ Loader {
} else {
// Fallback logic when app2unit is not used
if (app.runInTerminal) {
// If app.execute() fails for terminal apps, we handle it manually.
Logger.d("Dock", "Executing terminal app manually: " + app.name);
const terminal = Settings.data.appLauncher.terminalCommand.split(" ");
const command = terminal.concat(app.command);
Quickshell.execDetached(command);
try {
CompositorService.spawn(command);
} catch (e) {
Quickshell.execDetached(command);
}
} else if (app.command && app.command.length > 0) {
Quickshell.execDetached(app.command);
try {
CompositorService.spawn(app.command);
} catch (e) {
Quickshell.execDetached(app.command);
}
} else if (app.execute) {
app.execute();
} else {