From 1130021ba7fe9440e4e9cfb7cc065a7127feba6d Mon Sep 17 00:00:00 2001 From: wxlyyy <1556588440@qq.com> Date: Mon, 27 Oct 2025 02:36:04 +0800 Subject: [PATCH 1/2] Revert "Launcher: fix some apps not launching with custom prefix" This reverts commit 2de0473641138c97d4117251e3e23688242c27ec. --- Modules/Launcher/Plugins/ApplicationsPlugin.qml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Modules/Launcher/Plugins/ApplicationsPlugin.qml b/Modules/Launcher/Plugins/ApplicationsPlugin.qml index 9fb8cba9..043bc52b 100644 --- a/Modules/Launcher/Plugins/ApplicationsPlugin.qml +++ b/Modules/Launcher/Plugins/ApplicationsPlugin.qml @@ -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) { From ce65ff7f052d498d2372ff0be47b4c9a495c17e7 Mon Sep 17 00:00:00 2001 From: wxlyyy <1556588440@qq.com> Date: Mon, 27 Oct 2025 02:52:57 +0800 Subject: [PATCH 2/2] fix --- Modules/Launcher/Plugins/ApplicationsPlugin.qml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/Modules/Launcher/Plugins/ApplicationsPlugin.qml b/Modules/Launcher/Plugins/ApplicationsPlugin.qml index 043bc52b..2e07442c 100644 --- a/Modules/Launcher/Plugins/ApplicationsPlugin.qml +++ b/Modules/Launcher/Plugins/ApplicationsPlugin.qml @@ -207,17 +207,10 @@ Item { const prefix = Settings.data.appLauncher.customLaunchPrefix.split(" ") if (app.runInTerminal) { - // 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]) + const terminal = Settings.data.appLauncher.terminalCommand.split(" ") + const command = prefix.concat(terminal.concat(app.command)) Quickshell.execDetached(command) } else { - // Fallback to direct command execution const command = prefix.concat(app.command) Quickshell.execDetached(command) }