mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-06-04 11:16:03 +00:00
Merge pull request #377 from lonerOrz/fix/launcher
fix: the launcher cannot run pure command-line (CLI) programs
This commit is contained in:
@@ -320,6 +320,10 @@
|
||||
"use-app2unit": {
|
||||
"label": "App2Unit zum Starten von Anwendungen verwenden",
|
||||
"description": "Verwendet eine alternative Startmethode zur besseren Verwaltung von App-Prozessen und Problemvermeidung."
|
||||
},
|
||||
"terminal-command": {
|
||||
"label": "Terminalbefehl",
|
||||
"description": "Befehl zum Starten eines Terminals. Z.B. 'kitty -e' oder 'gnome-terminal --'."
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -318,6 +318,10 @@
|
||||
"use-app2unit": {
|
||||
"label": "Use App2Unit to launch applications",
|
||||
"description": "Uses an alternative launch method to better manage app processes and prevent issues."
|
||||
},
|
||||
"terminal-command": {
|
||||
"label": "Terminal command",
|
||||
"description": "Command to launch a terminal. E.g., 'kitty -e' or 'gnome-terminal --'."
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -316,6 +316,10 @@
|
||||
"use-app2unit": {
|
||||
"label": "Usar App2Unit para lanzar aplicaciones",
|
||||
"description": "Usa un método de lanzamiento alternativo para gestionar mejor los procesos de las aplicaciones y prevenir problemas."
|
||||
},
|
||||
"terminal-command": {
|
||||
"label": "Comando de terminal",
|
||||
"description": "Comando para iniciar un terminal. Por ejemplo, 'kitty -e' o 'gnome-terminal --'."
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -316,6 +316,10 @@
|
||||
"use-app2unit": {
|
||||
"label": "Utiliser App2Unit pour lancer les applications",
|
||||
"description": "Utilise une méthode de lancement alternative pour mieux gérer les processus des applications et prévenir les problèmes."
|
||||
},
|
||||
"terminal-command": {
|
||||
"label": "Commande du terminal",
|
||||
"description": "Commande pour lancer un terminal. Ex: 'kitty -e' ou 'gnome-terminal --'."
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -316,6 +316,10 @@
|
||||
"use-app2unit": {
|
||||
"label": "Usar App2Unit para iniciar aplicativos",
|
||||
"description": "Usa um método de inicialização alternativo para gerenciar melhor os processos de aplicativos e evitar problemas."
|
||||
},
|
||||
"terminal-command": {
|
||||
"label": "Comando do terminal",
|
||||
"description": "Comando para iniciar um terminal. Ex: 'kitty -e' ou 'gnome-terminal --'."
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -107,7 +107,8 @@
|
||||
"backgroundOpacity": 1,
|
||||
"pinnedExecs": [],
|
||||
"useApp2Unit": false,
|
||||
"sortByMostUsed": true
|
||||
"sortByMostUsed": true,
|
||||
"terminalCommand": "xterm -e"
|
||||
},
|
||||
"dock": {
|
||||
"autoHide": false,
|
||||
|
||||
@@ -239,6 +239,7 @@ Singleton {
|
||||
property list<string> pinnedExecs: []
|
||||
property bool useApp2Unit: false
|
||||
property bool sortByMostUsed: true
|
||||
property string terminalCommand: "xterm -e"
|
||||
}
|
||||
|
||||
// dock
|
||||
|
||||
@@ -161,10 +161,20 @@ Item {
|
||||
Quickshell.execDetached(["app2unit", "--", app.id + ".desktop"])
|
||||
else
|
||||
Quickshell.execDetached(["app2unit", "--"].concat(app.command))
|
||||
} else if (app.execute) {
|
||||
app.execute()
|
||||
} else {
|
||||
Logger.log("ApplicationsPlugin", `Could not launch: ${app.name}`)
|
||||
// Fallback logic when app2unit is not used
|
||||
if (app.runInTerminal) {
|
||||
// If app.execute() fails for terminal apps, we handle it manually.
|
||||
Logger.log("ApplicationsPlugin", "Executing terminal app manually: " + app.name)
|
||||
const terminal = Settings.data.appLauncher.terminalCommand.split(" ")
|
||||
const command = terminal.concat(app.command)
|
||||
Quickshell.execDetached(command)
|
||||
} else if (app.execute) {
|
||||
// Default execution for GUI apps
|
||||
app.execute()
|
||||
} else {
|
||||
Logger.log("ApplicationsPlugin", `Could not launch: ${app.name}. No valid launch method.`)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,6 +99,16 @@ ColumnLayout {
|
||||
onToggled: checked => Settings.data.appLauncher.useApp2Unit = checked
|
||||
}
|
||||
|
||||
NTextInput {
|
||||
label: I18n.tr("settings.launcher.settings.terminal-command.label")
|
||||
description: I18n.tr("settings.launcher.settings.terminal-command.description")
|
||||
Layout.fillWidth: true
|
||||
text: Settings.data.appLauncher.terminalCommand
|
||||
onEditingFinished: {
|
||||
Settings.data.appLauncher.terminalCommand = text
|
||||
}
|
||||
}
|
||||
|
||||
NDivider {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: Style.marginXL * scaling
|
||||
|
||||
Reference in New Issue
Block a user