(in-package :stumpwm) (defun echo-focus-window-hook (new old) (message "~a" new)) (defun echo-urgent-window-hook (target) (message "~a" target) ) (defun raise-urgent-window-hook (target) (when (should-be-raised target) (let* ((group (find-group (current-screen) "Default"))) (gselect group) (move-window-to-group target group) (gselect group) (pull-window target) (gselect group) (group-focus-window group target) (gselect group) ))) (defun remember-focus-window-hook (new old) (setf *globally-previous* *globally-current*) (setf *globally-current* new)) (defun click-conversation-focus-window-hook (new old) (when (or (window-matches-properties-p new :class "Carrier" :role "conversation") (window-matches-properties-p new :class "Pidgin" :role "conversation") ) (ratwarp 50 760) (ratclick 1) ; FIXME: it doesn't work (run-shell-command "echo -e 'ButtonPress 1\\nButtonRelease 1' | xmacroplay $DISPLAY") )) (add-hook *focus-window-hook* 'click-conversation-focus-window-hook) (defun renumbering-start-hook () (message "Starting renumbering hook") (place-existing-windows) (gselect (find-group (current-screen) "Net")) (net-window-sort) (switch-to-group (find-group (current-screen) "Base")) (repack-window-numbers) ) (defun modeline-start-hook () (message "Setting up modeline") (let ((group1 (find-if (lambda (x) (= (group-number x) 1)) (screen-groups (current-screen))))) (gselect group1)) (let ((window (global-matching-window :title "XWatchSystem"))) (if window (progn (move-window-to-group window (current-group)) (group-focus-window (current-group) window) (really-raise-window window) (my-mode-line :window window))))) (defun window-set-start-hook () (message "Restoring window set") (pull+push "IN-CURRENT-GROUP") (number-by-tags)) (defun echo-switch-group-hook (g1 g2) (format *error-output* "~s ~s" g1 g2))