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>
This commit is contained in:
alyingfish
2025-07-20 23:17:23 +08:00
committed by GitHub
parent 42b483b878
commit 5e78b09577
2 changed files with 6 additions and 1 deletions
@@ -160,6 +160,7 @@ Singleton {
property bool hoverToReveal: true // When false, only reveals on empty workspace
property list<string> pinnedApps: [ // IDs of pinned entries
"org.kde.dolphin", "kitty",]
property list<string> ignoredAppRegexes: []
}
property JsonObject language: JsonObject {
@@ -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: []