From 5e78b09577001d03b6cd8eca12c791cb3b70e29b Mon Sep 17 00:00:00 2001 From: alyingfish Date: Sun, 20 Jul 2025 23:17:23 +0800 Subject: [PATCH] feat: add option to ignore certain apps in dock (#1681) * feat: add option to ignore certain apps in dock Co-authored-by: end-4 <97237370+end-4@users.noreply.github.com> --- .config/quickshell/ii/modules/common/Config.qml | 1 + .config/quickshell/ii/modules/dock/DockApps.qml | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.config/quickshell/ii/modules/common/Config.qml b/.config/quickshell/ii/modules/common/Config.qml index 858439b8d..e97a537c8 100644 --- a/.config/quickshell/ii/modules/common/Config.qml +++ b/.config/quickshell/ii/modules/common/Config.qml @@ -160,6 +160,7 @@ Singleton { property bool hoverToReveal: true // When false, only reveals on empty workspace property list pinnedApps: [ // IDs of pinned entries "org.kde.dolphin", "kitty",] + property list ignoredAppRegexes: [] } property JsonObject language: JsonObject { diff --git a/.config/quickshell/ii/modules/dock/DockApps.qml b/.config/quickshell/ii/modules/dock/DockApps.qml index 81aedc1ad..623bdc23e 100644 --- a/.config/quickshell/ii/modules/dock/DockApps.qml +++ b/.config/quickshell/ii/modules/dock/DockApps.qml @@ -57,9 +57,13 @@ Item { if (pinnedApps.length > 0) { map.set("SEPARATOR", { pinned: false, toplevels: [] }); } - + + // Ignored apps + const ignoredRegexStrings = Config.options?.dock.ignoredAppRegexes ?? []; + const ignoredRegexes = ignoredRegexStrings.map(pattern => new RegExp(pattern, "i")); // Open windows for (const toplevel of ToplevelManager.toplevels.values) { + if (ignoredRegexes.some(re => re.test(toplevel.appId))) continue; if (!map.has(toplevel.appId.toLowerCase())) map.set(toplevel.appId.toLowerCase(), ({ pinned: false, toplevels: []