]> Freerunner's - simpledwindle.git/commitdiff
Allow regex for FLOATING and IGNORED classes
authorAndre Ramnitz <andre.ramnitz@mail.de>
Mon, 19 Oct 2026 19:34:09 +0000 (21:34 +0200)
committerAndre Ramnitz <andre.ramnitz@mail.de>
Mon, 19 Oct 2026 19:34:09 +0000 (21:34 +0200)
remove redundant log entries

contents/code/main.js
metadata.json

index 5016ed79764f97a1a4115f6c9de2ba400df0c9cf..a44ffb9824397018a9a9891c3cd6103c841de6b9 100644 (file)
@@ -1,25 +1,45 @@
 "use strict";
 
 // SimpleDwindle
-const VERSION = "0.3.2";
+const VERSION = "0.3.3";
 // KWin 6.8 - Minimal chronological Dwindle
 
 // ------------------------------------------------------------
 // Configuration
 // ------------------------------------------------------------
 
+// info: nomenclature in kwin is
+// class/appid => resourceClass
+//       title => caption
+
 const GAP = 8;
 
-// Always floating, never tiled
+// Floating by default, manually tileable via Meta+S
 const FLOATING_CLASSES = [
     // "org.kde.dolphin",
     "org.kde.kcalc",
     "systemsettings",
+    "okular",
+    "dolphin",
+    "qtpass",
+    "alsa-scarlett-gui",
+    "lstopo",
+    "LACT",
+    "ncmpcpp",
+    "MissionCenter",
+    "gradia",
 ];
 
 // Completely ignored by SimpleDwindle
 const IGNORED_CLASSES = [
     "wl-copy",
+    "steam",
+    "heroic",
+    /^steam_app.*$/,
+    /^.*\.exe$/i,
+    /^xdg-desktop-portal/,
+    /clipboard/i,
+    /^org\.kde\.spectacle$/,
 ];
 
 // ------------------------------------------------------------
@@ -56,9 +76,14 @@ function windowClass(w) {
 }
 
 function matchesClass(w, classes) {
-    return classes.some(c =>
-        c.toLowerCase() === windowClass(w)
-    );
+    const name = windowClass(w);
+
+    return classes.some(entry => {
+        if (entry instanceof RegExp)
+            return entry.test(name);
+
+        return String(entry).toLowerCase() === name;
+    });
 }
 
 function isCandidate(w) {
@@ -314,8 +339,6 @@ function arrange(layout) {
 // ------------------------------------------------------------
 
 function tileWindow(w) {
-    log("TILED: " + w.caption + " [" + w.resourceClass + "]");
-
     if (!isCandidate(w) ||
         isIgnored(w) ||
         contains(managed, w) ||
@@ -338,7 +361,7 @@ function tileWindow(w) {
 
     arrange(layout);
 
-    log("TILED: " + w.caption);
+    log("TILED: " + w.caption + " [" + w.resourceClass + "]");
 }
 
 function detachWindow(w) {
@@ -463,12 +486,12 @@ function watchWindow(w) {
 
 function handleWindowAdded(w) {
     log(
-    "WINDOW ADDED: " +
-    "caption=" + w.caption +
-    " class=" + w.resourceClass +
-    " normal=" + w.normalWindow +
-    " transient=" + Boolean(w.transient) +
-    " id=" + w.internalId
+        "WINDOW ADDED: " +
+        "caption=" + w.caption +
+        " class=" + w.resourceClass +
+        " normal=" + w.normalWindow +
+        " transient=" + Boolean(w.transient) +
+        " id=" + w.internalId
     );
     if (!isCandidate(w) || isIgnored(w))
         return;
index f26011c313423c04f2429b0c4c28107134e487bf..2a1b53dc80746882d9fff451f47da0aca1abf57a 100644 (file)
@@ -3,7 +3,7 @@
     "Id": "simpledwindle",
     "Name": "SimpleDwindle",
     "Description": "Minimal tiling and floating window manager",
-    "Version": "0.3.1",
+    "Version": "0.3.3",
     "License": "MIT"
   },
   "X-Plasma-API": "javascript",