-
Notifications
You must be signed in to change notification settings - Fork 0
/
window-misc.lisp
28 lines (25 loc) · 1.15 KB
/
window-misc.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
(defcommand select-window-by-id (id) ((:number "Window id: "))
(let ((win
(find-if (lambda (w) (eq (window-id w) id))
(group-windows (current-group)))))
(if win
(group-focus-window (current-group) win))))
(defcommand set-current-window-key (key) ((:key-seq "Window key: "))
(let ((cmd (format nil "select-window-by-id ~d" (window-id (current-window)))))
(when (and key (car key))
(define-key *top-map* (car key) cmd))))
(defcommand show-window-properties () ()
"Shows the properties of the current window. These properties can be
used for matching windows with run-or-raise or window placement
rules."
(let ((w (current-window)))
(if (not w)
(message "No active window!")
(message-no-timeout "class: ~A~%instance: ~A~%type: :~A~%role: ~A~%title: ~A~%ID: ~A"
(window-class w)
(window-res w)
(string (window-type w))
(window-role w)
(window-title w)
(window-id w)))))
(define-key *top-map* (kbd "M-H-s") "set-current-window-key")