Revert "Launcher: fix some apps not launching with custom prefix"

This reverts commit 2de0473641.
This commit is contained in:
wxlyyy
2025-10-27 02:36:04 +08:00
parent b4ecc50eed
commit 1130021ba7

View File

@@ -203,15 +203,22 @@ Item {
if (Settings.data.appLauncher.sortByMostUsed)
recordUsage(app)
if (Settings.data.appLauncher.customLaunchPrefixEnabled && Settings.data.appLauncher.customLaunchPrefix) {
// Use custom launch prefix
const prefix = Settings.data.appLauncher.customLaunchPrefix.split(" ")
if (app.runInTerminal) {
const command = prefix.concat([app.id + ".desktop"])
Logger.d("ApplicationsPlugin", "Launching via custom prefix (with desktop id): " + command.join(" "))
// For terminal apps, use the app command directly
const command = prefix.concat(app.command)
Quickshell.execDetached(command)
} else if (app.id) {
// For GUI apps, try to use the app name/executable name instead of desktop file
// This works better with commands like "niri msg action spawn --"
const appName = app.executableName || app.name.toLowerCase().replace(/\s+/g, '-')
const command = prefix.concat([appName])
Quickshell.execDetached(command)
} else {
// Fallback to direct command execution
const command = prefix.concat(app.command)
Logger.d("ApplicationsPlugin", "Launching via custom prefix (with command): " + command.join(" "))
Quickshell.execDetached(command)
}
} else if (Settings.data.appLauncher.useApp2Unit && app.id) {