From 2533c52e275eff0dc720f3260e8f43c063fd879b Mon Sep 17 00:00:00 2001 From: Ly-sec Date: Sat, 6 Sep 2025 00:30:47 +0200 Subject: [PATCH] Launcher: add app2unit options (hopefully) --- Commons/Settings.qml | 1 + Modules/Launcher/Plugins/ApplicationsPlugin.qml | 6 +++++- Modules/SettingsPanel/Tabs/LauncherTab.qml | 7 +++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Commons/Settings.qml b/Commons/Settings.qml index 9565e2c..097f5e9 100644 --- a/Commons/Settings.qml +++ b/Commons/Settings.qml @@ -278,6 +278,7 @@ Singleton { property string position: "center" property real backgroundOpacity: 1.0 property list pinnedExecs: [] + property bool useApp2Unit: false } // dock diff --git a/Modules/Launcher/Plugins/ApplicationsPlugin.qml b/Modules/Launcher/Plugins/ApplicationsPlugin.qml index 4c02e6b..8b88523 100644 --- a/Modules/Launcher/Plugins/ApplicationsPlugin.qml +++ b/Modules/Launcher/Plugins/ApplicationsPlugin.qml @@ -82,7 +82,11 @@ Item { "isImage": false, "onActivate": function () { Logger.log("ApplicationsPlugin", `Launching: ${app.name}`) - if (app.execute) { + + if (Settings.data.appLauncher.useApp2Unit && app.id) { + Logger.log("ApplicationsPlugin", `Using app2unit for: ${app.id}`) + Quickshell.execDetached(["app2unit", "--", app.id]) + } else if (app.execute) { app.execute() } else if (app.exec) { // Fallback to manual execution diff --git a/Modules/SettingsPanel/Tabs/LauncherTab.qml b/Modules/SettingsPanel/Tabs/LauncherTab.qml index f303273..6ca4ece 100644 --- a/Modules/SettingsPanel/Tabs/LauncherTab.qml +++ b/Modules/SettingsPanel/Tabs/LauncherTab.qml @@ -59,6 +59,13 @@ ColumnLayout { onToggled: checked => Settings.data.appLauncher.enableClipboardHistory = checked } + NToggle { + label: "Use App2Unit for Launching" + description: "Use app2unit -- 'desktop-entry' when launching applications for better systemd integration." + checked: Settings.data.appLauncher.useApp2Unit + onToggled: checked => Settings.data.appLauncher.useApp2Unit = checked + } + ColumnLayout { spacing: Style.marginXXS * scaling Layout.fillWidth: true