From pbrochard at common-lisp.net Sat Dec 5 20:50:33 2009 From: pbrochard at common-lisp.net (Philippe Brochard) Date: Sat, 05 Dec 2009 15:50:33 -0500 Subject: [clfswm-cvs] r270 - in clfswm: . contrib src Message-ID: Author: pbrochard Date: Sat Dec 5 15:50:32 2009 New Revision: 270 Log: src/clfswm.lisp (main): Add an alternate configuration filename parameter. load.lisp: Add a debuging code example. Modified: clfswm/ChangeLog clfswm/contrib/reboot-halt.lisp clfswm/load.lisp clfswm/src/clfswm-util.lisp clfswm/src/clfswm.lisp Modified: clfswm/ChangeLog ============================================================================== --- clfswm/ChangeLog (original) +++ clfswm/ChangeLog Sat Dec 5 15:50:32 2009 @@ -1,3 +1,10 @@ +2009-12-05 Philippe Brochard + + * src/clfswm.lisp (main): Add an alternate configuration filename + parameter. + + * load.lisp: Add a debuging code example. + 2009-11-14 Philippe Brochard * src/clfswm-configuration.lisp (create-configuration-menu): New Modified: clfswm/contrib/reboot-halt.lisp ============================================================================== --- clfswm/contrib/reboot-halt.lisp (original) +++ clfswm/contrib/reboot-halt.lisp Sat Dec 5 15:50:32 2009 @@ -55,7 +55,7 @@ (do-with-terminal "sudo halt")) (unless (find-menu 'reboot-halt-menu) - (add-sub-menu 'help-menu "Pause" 'reboot-halt-menu "Suspend/Reboot/Halt menu") + (add-sub-menu 'clfswm-menu "Pause" 'reboot-halt-menu "Suspend/Reboot/Halt menu") (add-menu-key 'reboot-halt-menu "s" 'do-suspend) (add-menu-key 'reboot-halt-menu "r" 'do-reboot) (add-menu-key 'reboot-halt-menu "h" 'do-halt)) Modified: clfswm/load.lisp ============================================================================== --- clfswm/load.lisp (original) +++ clfswm/load.lisp Sat Dec 5 15:50:32 2009 @@ -60,3 +60,13 @@ ;;(produce-all-docs) +;;; For debuging: start Xnest or Zephyr and +;;; add the lines above in a dot-clfswmrc-debug file +;;(setf *default-modifiers* '(:mod-2)) +;; +;;(defun my-add-escape () +;; (define-main-key ("Escape" :mod-2) 'exit-clfswm)) +;; +;;(add-hook *binding-hook* 'my-add-escape) +;; +;;(clfswm:main :display ":1" :alternate-conf #P"/where/is/dot-clfswmrc-debug") Modified: clfswm/src/clfswm-util.lisp ============================================================================== --- clfswm/src/clfswm-util.lisp (original) +++ clfswm/src/clfswm-util.lisp Sat Dec 5 15:50:32 2009 @@ -32,12 +32,17 @@ (getenv "HOME")) "/"))) -(defun conf-file-name () - (let* ((user-conf (probe-file (merge-pathnames (user-homedir-pathname) #p".clfswmrc"))) - (etc-conf (probe-file #p"/etc/clfswmrc")) - (config-user-conf (probe-file (make-pathname :directory (append (xdg-config-home) '("clfswm")) - :name "clfswmrc")))) - (or config-user-conf user-conf etc-conf))) +(let ((saved-conf-name nil)) + (defun conf-file-name (&optional alternate-name) + (unless (and saved-conf-name (not alternate-name)) + (let* ((user-conf (probe-file (merge-pathnames (user-homedir-pathname) #p".clfswmrc"))) + (etc-conf (probe-file #p"/etc/clfswmrc")) + (config-user-conf (probe-file (make-pathname :directory (append (xdg-config-home) '("clfswm")) + :name "clfswmrc"))) + (alternate-conf (probe-file alternate-name))) + (setf saved-conf-name (or alternate-conf config-user-conf user-conf etc-conf)))) + (print saved-conf-name) + saved-conf-name)) Modified: clfswm/src/clfswm.lisp ============================================================================== --- clfswm/src/clfswm.lisp (original) +++ clfswm/src/clfswm.lisp Sat Dec 5 15:50:32 2009 @@ -296,9 +296,10 @@ (defun main-unprotected (&key (display (or (getenv "DISPLAY") ":0")) protocol (base-dir (directory-namestring (or *load-truename* ""))) - (read-conf-file-p t) + (read-conf-file-p t) (alternate-conf nil) error-msg) (setf *contrib-dir* base-dir) + (conf-file-name alternate-conf) (when read-conf-file-p (read-conf-file)) (handler-case @@ -330,13 +331,15 @@ (defun main (&key (display (or (getenv "DISPLAY") ":0")) protocol (base-dir (directory-namestring (or *load-truename* ""))) - (read-conf-file-p t)) + (read-conf-file-p t) + (alternate-conf nil)) (let (error-msg) (catch 'exit-clfswm (loop (handler-case (main-unprotected :display display :protocol protocol :base-dir base-dir :read-conf-file-p read-conf-file-p + :alternate-conf alternate-conf :error-msg error-msg) (error (c) (let ((msg (format nil "CLFSWM Error: ~A." c))) From pbrochard at common-lisp.net Tue Dec 15 21:00:40 2009 From: pbrochard at common-lisp.net (Philippe Brochard) Date: Tue, 15 Dec 2009 16:00:40 -0500 Subject: [clfswm-cvs] r271 - clfswm/src Message-ID: Author: pbrochard Date: Tue Dec 15 16:00:39 2009 New Revision: 271 Log: Replace Menu* keys with Alt-F10* in bindings*.lisp Modified: clfswm/src/bindings-second-mode.lisp clfswm/src/bindings.lisp Modified: clfswm/src/bindings-second-mode.lisp ============================================================================== --- clfswm/src/bindings-second-mode.lisp (original) +++ clfswm/src/bindings-second-mode.lisp Tue Dec 15 16:00:39 2009 @@ -133,9 +133,10 @@ "start an emacs for another user" "exec xterm -e emacsremote") (define-shell (#\h) b-start-xclock "start an xclock" "exec xclock -d") - (define-second-key ("Menu") 'show-all-frames-info-key) - (define-second-key ("Menu" :shift) 'show-all-frames-info) - (define-second-key ("Menu" :control) 'toggle-show-root-frame) + (define-second-key ("F10" :mod-1) 'fast-layout-switch) + (define-second-key ("F10" :shift) 'show-all-frames-info-key) + (define-second-key ("F10" :shift :mod-1) 'show-all-frames-info) + (define-second-key ("F10" :control) 'toggle-show-root-frame) ;; Bind or jump functions (define-second-key ("1" :mod-1) 'bind-or-jump 1) (define-second-key ("2" :mod-1) 'bind-or-jump 2) Modified: clfswm/src/bindings.lisp ============================================================================== --- clfswm/src/bindings.lisp (original) +++ clfswm/src/bindings.lisp Tue Dec 15 16:00:39 2009 @@ -58,10 +58,10 @@ (define-main-key ("Page_Down" :mod-1) 'frame-raise-child) (define-main-key ("Home" :mod-1) 'switch-to-root-frame) (define-main-key ("Home" :mod-1 :shift) 'switch-and-select-root-frame) - (define-main-key ("Menu") 'fast-layout-switch) - (define-main-key ("Menu" :mod-1) 'show-all-frames-info-key) - (define-main-key ("Menu" :shift) 'show-all-frames-info) - (define-main-key ("Menu" :control) 'toggle-show-root-frame) + (define-main-key ("F10" :mod-1) 'fast-layout-switch) + (define-main-key ("F10" :shift) 'show-all-frames-info-key) + (define-main-key ("F10" :shift :mod-1) 'show-all-frames-info) + (define-main-key ("F10" :control) 'toggle-show-root-frame) (define-main-key (#\b :mod-1) 'banish-pointer) ;; Escape (define-main-key ("Escape" :control) 'ask-close/kill-current-window) From pbrochard at common-lisp.net Tue Dec 15 21:23:07 2009 From: pbrochard at common-lisp.net (Philippe Brochard) Date: Tue, 15 Dec 2009 16:23:07 -0500 Subject: [clfswm-cvs] r272 - in clfswm: . src Message-ID: Author: pbrochard Date: Tue Dec 15 16:23:06 2009 New Revision: 272 Log: Add a loop-hook parameter and a loop timeout. Modified: clfswm/ChangeLog clfswm/src/clfswm-generic-mode.lisp clfswm/src/clfswm.lisp clfswm/src/package.lisp Modified: clfswm/ChangeLog ============================================================================== --- clfswm/ChangeLog (original) +++ clfswm/ChangeLog Tue Dec 15 16:23:06 2009 @@ -1,3 +1,11 @@ +2009-12-15 Philippe Brochard + + * src/clfswm.lisp (main-loop): Add a *loop-hook* parameter and a + loop timeout. + + * src/clfswm-generic-mode.lisp (generic-mode): Add a loop-hook + parameter and a loop timeout. + 2009-12-05 Philippe Brochard * src/clfswm.lisp (main): Add an alternate configuration filename Modified: clfswm/src/clfswm-generic-mode.lisp ============================================================================== --- clfswm/src/clfswm-generic-mode.lisp (original) +++ clfswm/src/clfswm-generic-mode.lisp Tue Dec 15 16:23:06 2009 @@ -27,6 +27,7 @@ (defun generic-mode (exit-tag &key enter-function loop-function leave-function + (loop-hook *loop-hook*) (button-press-hook *button-press-hook*) (button-release-hook *button-release-hook*) (motion-notify-hook *motion-notify-hook*) @@ -69,8 +70,9 @@ (unwind-protect (catch exit-tag (loop + (call-hook loop-hook) (nfuncall loop-function) (xlib:display-finish-output *display*) - (xlib:process-event *display* :handler #'handler-function) + (xlib:process-event *display* :handler #'handler-function :timeout *loop-timeout*) (xlib:display-finish-output *display*))) (nfuncall leave-function)))) Modified: clfswm/src/clfswm.lisp ============================================================================== --- clfswm/src/clfswm.lisp (original) +++ clfswm/src/clfswm.lisp Tue Dec 15 16:23:06 2009 @@ -205,8 +205,9 @@ (defun main-loop () (loop (with-xlib-protect + (call-hook *loop-hook*) (xlib:display-finish-output *display*) - (xlib:process-event *display* :handler #'handle-event)))) + (xlib:process-event *display* :handler #'handle-event :timeout *loop-timeout*)))) ;;(dbg "Main loop finish" c))))) Modified: clfswm/src/package.lisp ============================================================================== --- clfswm/src/package.lisp (original) +++ clfswm/src/package.lisp Tue Dec 15 16:23:06 2009 @@ -59,6 +59,9 @@ (defparameter *root* nil) (defparameter *no-focus-window* nil) +(defparameter *loop-timeout* 0.1 + "Config(): Maximum time (in seconds) to wait before calling *loop-hook*") + (defparameter *pixmap-buffer* nil) (defparameter *contrib-dir* "") @@ -166,6 +169,7 @@ (defparameter *menu* (make-menu :name 'main :doc "Main menu")) + ;;; Main mode hooks (set in clfswm.lisp) (defparameter *button-press-hook* nil "Config(Hook group):") @@ -233,7 +237,10 @@ (defparameter *binding-hook* nil - "Config(Hook group):") + "Config(Hook group): Hook executed when keys/buttons are bounds") + +(defparameter *loop-hook* nil + "Config(Hook group): Kook executed on each event loop") (defparameter *in-second-mode* nil)