stumpwm-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[STUMP] [PATCH] Add show-window-properties command.


From: John Li
Subject: [STUMP] [PATCH] Add show-window-properties command.
Date: Thu, 31 Jul 2008 05:19:35 -0400
User-agent: Mutt/1.5.18 (2008-05-17)

---

This is uglier than I'd like, but I couldn't think of a better way to
build the string.

This has to use echo-string and *suppress-echo-timeout* because
message-no-timeout will run the string through the formatter, so if I
have a shell open with title "yaybox: ~/stump", it breaks.

 NEWS      |    2 ++
 user.lisp |   14 ++++++++++++++
 2 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/NEWS b/NEWS
index 5192634..10551ad 100644
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,8 @@ This file documents user visible changes between versions of 
StumpWM
 
 ** added info command
 
+** new command show-window-properties
+
 * Changes since 0.9.3
 ** new %interactivep% variable
 see defcommand in the manual.
diff --git a/user.lisp b/user.lisp
index 71f11ac..aaf0837 100644
--- a/user.lisp
+++ b/user.lisp
@@ -435,3 +435,17 @@ (defmacro defprogram-shortcut (name &key (command 
(string-downcase (string name)
      (defcommand ,name () ()
        (run-or-raise ,command ,props))
      (define-key ,map ,key ,(string-downcase (string name)))))
+
+(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))
+        (nl (string #\NewLine))
+        (*suppress-echo-timeout* t))
+    (echo-string (current-screen)
+                 (concat "class:    " (window-class w) nl
+                         "instance: " (window-res w) nl
+                         "type:     :" (string (window-type w)) nl
+                         "role:     " (window-role w) nl
+                         "title:    " (window-title w)))))
-- 
1.5.6.3





reply via email to

[Prev in Thread] Current Thread [Next in Thread]