"use strict";
-const VERSION = "0.7.1";
+const VERSION = "0.7.2";
// ------------------------------------------------------------
// Configuration
// info: nomenclature in kwin is
// class/appid => resourceClass
// title => caption
+// Exception entries: class, regex, or [class, title].
+// An omitted title matches any caption; use /.*/ explicitly if preferred.
+// Strings match exactly (case-insensitive); regexes match patterns.
const GAP = 8;
const RESIZE_STEP = 0.05;
const FLOATING_CLASSES = [
// "org.kde.dolphin",
// /^org\.kde.*/,
+ "kcm_klassydecoration",
+ "klassy-settings",
/^com\.system76\..*/,
"org.kde.dolphin",
"org.kde.ark",
"ncmpcpp",
"io.missioncenter.MissionCenter",
"be.alexandervanhee.gradia",
+ ["firefox-bin", "Bild-im-Bild"],
];
// Completely ignored by SimpleDwindle
return String(w.resourceClass || "").toLowerCase();
}
+function matchesPattern(value, pattern) {
+ if (pattern instanceof RegExp) {
+ pattern.lastIndex = 0;
+ return pattern.test(value);
+ }
+
+ return String(pattern).toLowerCase() === value.toLowerCase();
+}
+
function matchesClass(w, classes) {
const name = windowClass(w);
+ const title = String(w.caption || "");
return classes.some(entry => {
- if (entry instanceof RegExp)
- return entry.test(name);
-
- return String(entry).toLowerCase() === name;
+ const pair = Array.isArray(entry) ? entry : [entry];
+ return matchesPattern(name, pair[0]) &&
+ (pair.length < 2 || matchesPattern(title, pair[1]));
});
}