Commit
19d191f2e49457e9f90aaff6cff96b2001b1269b
clwm-ext: ignored-clients-mixin
Raymond E. Pasco <ray@ameretat.dev> · 2026-10-27 06:45 UTC
4 files changed,
+39
−3
modified clwm-ext.lisp
| @@ -8,4 +8,6 @@ | |||
| 8 | 8 | ;; sloppy-focus-follows-mouse-mixin | |
| 9 | 9 | #:sloppy-focus-follows-mouse-mixin | |
| 10 | 10 | ;; focus-tracking-mixin | |
| 11 | - | #:focus-tracking-mixin #:focused-client)) | |
| 11 | + | #:focus-tracking-mixin #:focused-client | |
| 12 | + | ;; ignored-clients-mixin | |
| 13 | + | #:ignored-clients-mixin #:ignore-window-p #:ignored-window-names)) | |
added clwm-ext/ignored-clients-mixin.lisp mode 100644
| @@ -0,0 +1,32 @@ | |||
| 1 | + | ;;;; common lisp window manager | |
| 2 | + | ;;;; | |
| 3 | + | ;;;; ignore some clients | |
| 4 | + | ||
| 5 | + | (in-package #:clwm-ext) | |
| 6 | + | ||
| 7 | + | (defclass ignored-clients-mixin () () | |
| 8 | + | (:documentation "Leave some windows unmanaged.")) | |
| 9 | + | ||
| 10 | + | (defgeneric ignore-window-p (wm window) | |
| 11 | + | (:documentation "Whether to leave a window unmanaged.") | |
| 12 | + | (:method-combination or)) | |
| 13 | + | (defgeneric ignored-window-names (wm) | |
| 14 | + | (:documentation "Names to match against WM_CLASS and WM_NAME, | |
| 15 | + | and ignore if they match.") | |
| 16 | + | (:method-combination append)) | |
| 17 | + | ||
| 18 | + | (defmethod ignore-window-p or ((wm ignored-clients-mixin) window) | |
| 19 | + | (let ((names (ignored-window-names wm))) | |
| 20 | + | (and names | |
| 21 | + | (multiple-value-bind | |
| 22 | + | (instance class) (xlib:get-wm-class window) | |
| 23 | + | (let ((window-names | |
| 24 | + | (list instance class (xlib:wm-name window)))) | |
| 25 | + | (some (lambda (name) | |
| 26 | + | (member name window-names :test #'equal)) | |
| 27 | + | names)))))) | |
| 28 | + | (defmethod ignored-window-names append ((wm ignored-clients-mixin)) | |
| 29 | + | '()) | |
| 30 | + | ||
| 31 | + | (defmethod manage-window-p and ((wm ignored-clients-mixin) window) | |
| 32 | + | (not (ignore-window-p wm window))) | |
modified clwm.asd
| @@ -15,5 +15,6 @@ | |||
| 15 | 15 | :pathname "clwm-ext" | |
| 16 | 16 | :serial t | |
| 17 | 17 | :components ((:file "sloppy-focus-follows-mouse-mixin") | |
| 18 | - | (:file "focus-tracking-mixin"))) | |
| 18 | + | (:file "focus-tracking-mixin") | |
| 19 | + | (:file "ignored-clients-mixin"))) | |
| 19 | 20 | (:file "clwm-user"))) | |
modified example-init.lisp
| @@ -4,7 +4,8 @@ | |||
| 4 | 4 | ||
| 5 | 5 | (in-package #:clwm-user) | |
| 6 | 6 | ||
| 7 | - | (defclass my-wm (focus-tracking-mixin | |
| 7 | + | (defclass my-wm (ignored-clients-mixin | |
| 8 | + | focus-tracking-mixin | |
| 8 | 9 | sloppy-focus-follows-mouse-mixin | |
| 9 | 10 | wm) | |
| 10 | 11 | ()) | |