mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
feat: spawn application process via compositor
This commit is contained in:
+11
-3
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user