diff --git a/Modules/Bar/Widgets/Taskbar.qml b/Modules/Bar/Widgets/Taskbar.qml index 339727ef1..66c01b6a5 100644 --- a/Modules/Bar/Widgets/Taskbar.qml +++ b/Modules/Bar/Widgets/Taskbar.qml @@ -413,12 +413,12 @@ Item { try { const app = DesktopEntries.byId(appId); - if (Settings.data.appLauncher.customLaunchPrefixEnabled && Settings.data.appLauncher.customLaunchPrefix) { + if (Settings.data.appLauncher.customLaunchPrefixEnabled && Settings.data.appLauncher.customLaunchPrefix.trim() !== "") { // Use custom launch prefix - const prefix = Settings.data.appLauncher.customLaunchPrefix.split(" "); + const prefix = Settings.data.appLauncher.customLaunchPrefix.trim().split(" "); - if (app.runInTerminal) { - const terminal = Settings.data.appLauncher.terminalCommand.split(" "); + if (app.runInTerminal && Settings.data.appLauncher.terminalCommand.trim() !== "") { + const terminal = Settings.data.appLauncher.terminalCommand.trim().split(" "); const command = prefix.concat(terminal.concat(app.command)); Quickshell.execDetached(command); } else { @@ -426,9 +426,9 @@ Item { Quickshell.execDetached(command); } } else { - if (app.runInTerminal) { + if (app.runInTerminal && Settings.data.appLauncher.terminalCommand.trim() !== "") { Logger.d("Taskbar", "Executing terminal app manually: " + app.name); - const terminal = Settings.data.appLauncher.terminalCommand.split(" "); + const terminal = Settings.data.appLauncher.terminalCommand.trim().split(" "); const command = terminal.concat(app.command); CompositorService.spawn(command); } else if (app.command && app.command.length > 0) { diff --git a/Modules/Dock/DockContent.qml b/Modules/Dock/DockContent.qml index 09b495301..89b2eb8a4 100644 --- a/Modules/Dock/DockContent.qml +++ b/Modules/Dock/DockContent.qml @@ -145,11 +145,11 @@ Item { return; } - if (Settings.data.appLauncher.customLaunchPrefixEnabled && Settings.data.appLauncher.customLaunchPrefix) { - const prefix = Settings.data.appLauncher.customLaunchPrefix.split(" "); + if (Settings.data.appLauncher.customLaunchPrefixEnabled && Settings.data.appLauncher.customLaunchPrefix.trim() !== "") { + const prefix = Settings.data.appLauncher.customLaunchPrefix.trim().split(" "); - if (app.runInTerminal) { - const terminal = Settings.data.appLauncher.terminalCommand.split(" "); + if (app.runInTerminal && Settings.data.appLauncher.terminalCommand.trim() !== "") { + const terminal = Settings.data.appLauncher.terminalCommand.trim().split(" "); const command = prefix.concat(terminal.concat(app.command)); Quickshell.execDetached(command); } else { @@ -157,9 +157,9 @@ Item { Quickshell.execDetached(command); } } else { - if (app.runInTerminal) { + if (app.runInTerminal && Settings.data.appLauncher.terminalCommand.trim() !== "") { Logger.d("Dock", "Executing terminal app manually: " + app.name); - const terminal = Settings.data.appLauncher.terminalCommand.split(" "); + const terminal = Settings.data.appLauncher.terminalCommand.trim().split(" "); const command = terminal.concat(app.command); CompositorService.spawn(command); } else if (app.command && app.command.length > 0) { diff --git a/Modules/Panels/Launcher/Providers/ApplicationsProvider.qml b/Modules/Panels/Launcher/Providers/ApplicationsProvider.qml index fac28e510..0f17049c7 100644 --- a/Modules/Panels/Launcher/Providers/ApplicationsProvider.qml +++ b/Modules/Panels/Launcher/Providers/ApplicationsProvider.qml @@ -553,13 +553,13 @@ Item { return; } - if (Settings.data.appLauncher.customLaunchPrefixEnabled && Settings.data.appLauncher.customLaunchPrefix) { + if (Settings.data.appLauncher.customLaunchPrefixEnabled && Settings.data.appLauncher.customLaunchPrefix.trim() !== "") { // Use custom launch prefix - const prefix = Settings.data.appLauncher.customLaunchPrefix.split(" "); - Logger.d("ApplicationsProvider", `Using custom launch prefix: ${Settings.data.appLauncher.customLaunchPrefix}`); + const prefix = Settings.data.appLauncher.customLaunchPrefix.trim().split(" "); + Logger.d("ApplicationsProvider", `Using custom launch prefix: ${Settings.data.appLauncher.customLaunchPrefix.trim()}`); - if (app.runInTerminal) { - const terminal = Settings.data.appLauncher.terminalCommand.split(" "); + if (app.runInTerminal && Settings.data.appLauncher.terminalCommand.trim() !== "") { + const terminal = Settings.data.appLauncher.terminalCommand.trim().split(" "); const command = prefix.concat(terminal.concat(app.command)); Logger.d("ApplicationsProvider", `Executing command (with prefix and terminal): ${command.join(" ")}`); Quickshell.execDetached(command); @@ -569,9 +569,9 @@ Item { Quickshell.execDetached(command); } } else { - if (app.runInTerminal) { + if (app.runInTerminal && Settings.data.appLauncher.terminalCommand.trim() !== "") { Logger.d("ApplicationsProvider", "Executing terminal app manually: " + app.name); - const terminal = Settings.data.appLauncher.terminalCommand.split(" "); + const terminal = Settings.data.appLauncher.terminalCommand.trim().split(" "); const command = terminal.concat(app.command); Logger.d("ApplicationsProvider", "Executing command (manual terminal): " + command.join(" ")); CompositorService.spawn(command); diff --git a/Modules/Panels/Launcher/Providers/ClipboardProvider.qml b/Modules/Panels/Launcher/Providers/ClipboardProvider.qml index ddb8aa1d3..db44473f6 100644 --- a/Modules/Panels/Launcher/Providers/ClipboardProvider.qml +++ b/Modules/Panels/Launcher/Providers/ClipboardProvider.qml @@ -385,12 +385,12 @@ Item { var actions = []; // Annotation tool for images - if (item.isImage && Settings.data.appLauncher.screenshotAnnotationTool !== "") { + if (item.isImage && Settings.data.appLauncher.screenshotAnnotationTool.trim() !== "") { actions.push({ "icon": "pencil", "tooltip": I18n.tr("tooltips.open-annotation-tool"), "action": function () { - var tool = Settings.data.appLauncher.screenshotAnnotationTool; + var tool = Settings.data.appLauncher.screenshotAnnotationTool.trim(); Quickshell.execDetached(["sh", "-c", "cliphist decode " + item.clipboardId + " | " + tool]); if (launcher) launcher.close(); diff --git a/Modules/Panels/Settings/Tabs/Launcher/ExecuteSubTab.qml b/Modules/Panels/Settings/Tabs/Launcher/ExecuteSubTab.qml index 07fab76f1..f142fcb85 100644 --- a/Modules/Panels/Settings/Tabs/Launcher/ExecuteSubTab.qml +++ b/Modules/Panels/Settings/Tabs/Launcher/ExecuteSubTab.qml @@ -15,8 +15,7 @@ ColumnLayout { description: I18n.tr("panels.launcher.settings-terminal-command-description") Layout.fillWidth: true text: Settings.data.appLauncher.terminalCommand - onTextChanged: { - Settings.data.appLauncher.terminalCommand = text; + onTextChanged: Settings.data.appLauncher.terminalCommand = text } }