[clfswm-devel] Create frames on start
Oleksandr Kozachuk
ddeus.clfswm at mailnull.com
Wed Oct 17 22:15:41 UTC 2012
Hi again!
I would like to create and configure some frames at startup and have now
this code in my clfswmrc for it:
;; -----------------------------------------------------------------------------
(defun set-frame-layout-fast (layout &optional (frame (current-child)))
(when (frame-p frame)
(set-frame-default frame)
(setf (frame-layout frame) layout)
(show-all-children frame)))
(defun create-bounded-frame (name parent layout &optional (slot nil))
(let ((frame (add-frame (create-frame :name name) parent)))
(set-frame-layout-fast layout frame)
(when slot (bind-child-on-slot slot frame))
frame))
(defun ok-init-hook ()
(let ((root (create-bounded-frame "Root" *root-frame* #'tile-space-layout)))
(let* ((default (create-bounded-frame "Default" root #'tile-space-layout 0))
(devel (create-bounded-frame "Devel" root #'tile-space-layout 1))
(www (create-bounded-frame "WWW" root #'tile-space-layout 2))
(unmanaged (create-bounded-frame "Unmanaged" root #'tile-left-layout 3)))
(create-bounded-frame "Devel P2" devel #'tile-left-layout 4)
(create-bounded-frame "Devel P1" devel #'tile-left-layout 5)
(setf (frame-managed-type unmanaged) nil))
(define-as-root root 0 0 (xlib:screen-width *screen*) (xlib:screen-height *screen*))
(focus-all-children root root)))
(setf *init-hook* '(ok-init-hook))
;; -----------------------------------------------------------------------------
It works, but i do not know if it is a goot way to do it, because i
replace the initialization function fully and i am not sure about root
frames. How are you doing that?
Other thing is my "bind-child-on-slot" function, it would be nice to
have additional optional parameter in the normal "bind-on-slot" function
which is bound per default to (current-child), instead of using
(current-child) directly.
Best regards,
Alex.
More information about the clfswm-devel
mailing list