forked from Shinonome/dots-hyprland
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:
@@ -160,6 +160,7 @@ Singleton {
|
|||||||
property bool hoverToReveal: true // When false, only reveals on empty workspace
|
property bool hoverToReveal: true // When false, only reveals on empty workspace
|
||||||
property list<string> pinnedApps: [ // IDs of pinned entries
|
property list<string> pinnedApps: [ // IDs of pinned entries
|
||||||
"org.kde.dolphin", "kitty",]
|
"org.kde.dolphin", "kitty",]
|
||||||
|
property list<string> ignoredAppRegexes: []
|
||||||
}
|
}
|
||||||
|
|
||||||
property JsonObject language: JsonObject {
|
property JsonObject language: JsonObject {
|
||||||
|
|||||||
@@ -58,8 +58,12 @@ Item {
|
|||||||
map.set("SEPARATOR", { pinned: false, toplevels: [] });
|
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
|
// Open windows
|
||||||
for (const toplevel of ToplevelManager.toplevels.values) {
|
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(), ({
|
if (!map.has(toplevel.appId.toLowerCase())) map.set(toplevel.appId.toLowerCase(), ({
|
||||||
pinned: false,
|
pinned: false,
|
||||||
toplevels: []
|
toplevels: []
|
||||||
|
|||||||
Reference in New Issue
Block a user