From 5e03afe7f018dddb54563cd7a08364a96608caa9 Mon Sep 17 00:00:00 2001 From: purian23 Date: Sun, 4 Jan 2026 22:33:50 -0500 Subject: [PATCH] feat: Implement DMS Core Persistent Apps --- quickshell/Modules/AppDrawer/AppLauncher.qml | 22 ++++++- quickshell/Services/AppSearchService.qml | 62 ++++++++++++++++++++ 2 files changed, 81 insertions(+), 3 deletions(-) diff --git a/quickshell/Modules/AppDrawer/AppLauncher.qml b/quickshell/Modules/AppDrawer/AppLauncher.qml index 58e4701e..fe2c8c09 100644 --- a/quickshell/Modules/AppDrawer/AppLauncher.qml +++ b/quickshell/Modules/AppDrawer/AppLauncher.qml @@ -114,9 +114,13 @@ Item { const items = AppSearchService.getPluginItems(pluginCategory, ""); emptyTriggerItems = emptyTriggerItems.concat(items); }); - apps = AppSearchService.applications.concat(emptyTriggerItems); + // Add Core Apps + const coreItems = AppSearchService.getCoreApps(""); + apps = AppSearchService.applications.concat(emptyTriggerItems).concat(coreItems); } else { apps = AppSearchService.getAppsInCategory(selectedCategory).slice(0, maxResults); + const coreItems = AppSearchService.getCoreApps("").filter(app => app.categories.includes(selectedCategory)); + apps = apps.concat(coreItems); } } else { if (selectedCategory === allCategory) { @@ -129,7 +133,9 @@ Item { const items = AppSearchService.getPluginItems(pluginCategory, searchQuery); emptyTriggerItems = emptyTriggerItems.concat(items); }); - apps = apps.concat(emptyTriggerItems); + + const coreItems = AppSearchService.getCoreApps(searchQuery); + apps = apps.concat(emptyTriggerItems).concat(coreItems); } else { const categoryApps = AppSearchService.getAppsInCategory(selectedCategory); if (categoryApps.length > 0) { @@ -139,6 +145,9 @@ Item { } else { apps = []; } + + const coreItems = AppSearchService.getCoreApps(searchQuery).filter(app => app.categories.includes(selectedCategory)); + apps = apps.concat(coreItems); } } } @@ -173,7 +182,7 @@ Item { seenNames.add(itemKey); uniqueApps.push(app); - const isPluginItem = app.action !== undefined; + const isPluginItem = app.isCore ? false : (app.action !== undefined); filteredModel.append({ "name": app.name || "", "exec": app.execString || app.exec || app.action || "", @@ -181,6 +190,7 @@ Item { "comment": app.comment || "", "categories": app.categories || [], "isPlugin": isPluginItem, + "isCore": app.isCore === true, "appIndex": uniqueApps.length - 1 }); } @@ -237,6 +247,12 @@ Item { const actualApp = _uniqueApps[appData.appIndex]; + if (appData.isCore) { + AppSearchService.executeCoreApp(actualApp); + appLaunched(appData); + return; + } + if (appData.isPlugin) { const pluginId = getPluginIdForItem(actualApp); if (pluginId) { diff --git a/quickshell/Services/AppSearchService.qml b/quickshell/Services/AppSearchService.qml index 86ea5056..328983a2 100644 --- a/quickshell/Services/AppSearchService.qml +++ b/quickshell/Services/AppSearchService.qml @@ -42,6 +42,68 @@ Singleton { _cachedCategories = null; } + readonly property var coreApps: [ + { + name: "DMS Settings", + icon: Qt.resolvedUrl("../assets/danklogo2.svg"), + comment: "Manage DMS configuration", + action: "ipc:settings", + categories: ["Settings", "System"], + isCore: true + }, + { + name: "DMS Notepad", + icon: "material:description", + comment: "Quick notes", + action: "ipc:notepad", + categories: ["Office", "Utility"], + isCore: true + }, + { + name: "DMS System Monitor", + icon: "material:monitor_heart", + comment: "System monitor and process list", + action: "ipc:processlist", + categories: ["System", "Monitor"], + isCore: true + } + ] + + function getCoreApps(query) { + if (!query || query.length === 0) { + return coreApps; + } + + const lowerQuery = query.toLowerCase(); + return coreApps.filter(app => { + return app.name.toLowerCase().includes(lowerQuery) || app.comment.toLowerCase().includes(lowerQuery); + }); + } + + function executeCoreApp(app) { + if (!app || !app.action) { + return false; + } + + const actionParts = app.action.split(":"); + const actionType = actionParts[0]; + const actionTarget = actionParts[1]; + + if (actionType === "ipc") { + if (actionTarget === "settings") { + Quickshell.execDetached(["dms", "ipc", "call", "settings", "toggle"]); + return true; + } else if (actionTarget === "notepad") { + Quickshell.execDetached(["dms", "ipc", "call", "notepad", "toggle"]); + return true; + } else if (actionTarget === "processlist") { + Quickshell.execDetached(["dms", "ipc", "call", "processlist", "focusOrToggle"]); + return true; + } + } + return false; + } + Connections { target: DesktopEntries function onApplicationsChanged() {