Basic Window Snooper



Hi all,

just in case anyone is interrested: A basic window snooper:

(it requires `display-message-with-timeout' from 1.6.0)

***************************************************************************

;; Window Snooping

(defvar window-snooper-timeout 7)

(define (window-snooper w)
  (let ((window-wm-name (get-x-text-property w 'WM_NAME))
        (window-net-wm-name (get-x-text-property w '_NET_WM_NAME))
        (window-width (car (window-dimensions w)))
        (window-height (cdr (window-dimensions w))))
    (display-message-with-timeout
      (format nil "About the currently focused window:\
        \n\nWM_NAME:\t\t %s\
        \n_NET_WM_NAME:\t %s\
        \nWidth:\t\t\t %s pixels\
        \nHeight:\t\t\t %s pixels"
        window-wm-name
        window-net-wm-name
        window-width
        window-height)
          window-snooper-timeout )))

( define-command 'window-snooper window-snooper #:spec "%W" )

( bind-keys global-keymap "C-S-s" 'window-snooper )

***************************************************************************

TODO:

- truncated [" and "] stuff
- get state infos (and display it)
- get image (and draw it)
- get keymap for this window (and display it)
- get window-matchers for this window (and display it)
- more?

Chris

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil



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