forked from Shinonome/dots-hyprland
Add option to ignore certain apps in dock (#1303)
This commit is contained in:
@@ -199,6 +199,7 @@
|
||||
"firefox",
|
||||
"org.gnome.Nautilus"
|
||||
],
|
||||
"ignoredAppsRegex": [],
|
||||
"layer": "top",
|
||||
"monitorExclusivity": true, // Dock will move to other monitor along with focus if enabled
|
||||
"searchPinnedAppIcons": false, // Try to search for the correct icon if the app class isn't an icon name
|
||||
|
||||
@@ -119,6 +119,21 @@ const Taskbar = (monitor) => Widget.Box({
|
||||
const client = Hyprland.clients[i];
|
||||
if (client["pid"] == -1) return;
|
||||
const appClass = substitute(client.class);
|
||||
const ignoredAppsRegex = userOptions.dock.ignoredAppsRegex || [];
|
||||
let isIgnored = false;
|
||||
|
||||
for (const regex of ignoredAppsRegex) {
|
||||
try {
|
||||
const pattern = new RegExp(regex);
|
||||
if (pattern.test(appClass)) {
|
||||
isIgnored = true;
|
||||
break;
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
if (isIgnored) continue;
|
||||
|
||||
// for (const appName of userOptions.dock.pinnedApps) {
|
||||
// if (appClass.includes(appName.toLowerCase()))
|
||||
// return null;
|
||||
|
||||
Reference in New Issue
Block a user