From dd882401cea036d75e45963530aa06e4a770f5f1 Mon Sep 17 00:00:00 2001 From: lysec Date: Thu, 16 Oct 2025 12:29:06 +0200 Subject: [PATCH] LauncherTab: check if app2unit exists --- Modules/Settings/Tabs/LauncherTab.qml | 10 ++++++++-- Services/ProgramCheckerService.qml | 2 ++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Modules/Settings/Tabs/LauncherTab.qml b/Modules/Settings/Tabs/LauncherTab.qml index b64f26b6..b19332a3 100644 --- a/Modules/Settings/Tabs/LauncherTab.qml +++ b/Modules/Settings/Tabs/LauncherTab.qml @@ -95,8 +95,14 @@ ColumnLayout { NToggle { label: I18n.tr("settings.launcher.settings.use-app2unit.label") description: I18n.tr("settings.launcher.settings.use-app2unit.description") - checked: Settings.data.appLauncher.useApp2Unit - onToggled: checked => Settings.data.appLauncher.useApp2Unit = checked + checked: Settings.data.appLauncher.useApp2Unit && ProgramCheckerService.app2unitAvailable + enabled: ProgramCheckerService.app2unitAvailable + opacity: ProgramCheckerService.app2unitAvailable ? 1.0 : 0.6 + onToggled: checked => { + if (ProgramCheckerService.app2unitAvailable) { + Settings.data.appLauncher.useApp2Unit = checked + } + } } NTextInput { diff --git a/Services/ProgramCheckerService.qml b/Services/ProgramCheckerService.qml index 268274e3..94b65066 100644 --- a/Services/ProgramCheckerService.qml +++ b/Services/ProgramCheckerService.qml @@ -18,6 +18,7 @@ Singleton { property bool fuzzelAvailable: false property bool gpuScreenRecorderAvailable: false property bool wlsunsetAvailable: false + property bool app2unitAvailable: false // Discord client auto-detection property var availableDiscordClients: [] @@ -85,6 +86,7 @@ Singleton { "ghosttyAvailable": ["which", "ghostty"], "footAvailable": ["which", "foot"], "fuzzelAvailable": ["which", "fuzzel"], + "app2unitAvailable": ["which", "app2unit"], "gpuScreenRecorderAvailable": ["sh", "-c", "command -v gpu-screen-recorder >/dev/null 2>&1 || (command -v flatpak >/dev/null 2>&1 && flatpak list --app | grep -q 'com.dec05eba.gpu_screen_recorder')"], "wlsunsetAvailable": ["which", "wlsunset"] })