;;;; Create my favorite frame arrangement on my CSL laptop. (require 'cl) (defun fresh-frame-set (param-lists) ;; Record the current frames; make new frames; then delete the old ;; frames. (let ((old-frames (frame-list))) (dolist (pl param-lists) (make-frame pl)) (dolist (f old-frames) (when (eq (framep f) 'x) (delete-frame f))))) (defun frida-frames-dfp () "Arrange frames for working with the 2407WFPHC flat panel display." (interactive) (add-to-list 'default-frame-alist '(font . "-*-DejaVu sans mono-medium-r-normal-*-12-*-*-*-m-0-*-*")) (fresh-frame-set '(((display . ":0.0") (top . 0) (left . 224) (width . 80) (height . 54)) ((display . ":0.0") (top . 0) (left . 832) (width . 80) (height . 54)) ((display . ":0.1") (top . 0) (left . 96) (width . 80) (height . 74)) ((display . ":0.1") (top . 0) (left . 704) (width . 80) (height . 74)) ((display . ":0.1") (top . 0) (left . 1312) (width . 80) (height . 74))))) (defun frida-frames-solo () "Arrange frames for working on the lid screen alone." (interactive) (add-to-list 'default-frame-alist '(font . "-*-DejaVu sans mono-medium-r-normal-*-12-*-*-*-m-0-*-*")) (fresh-frame-set '(((display . ":0.0") (top . 0) (left . 832) (width . 80) (height . 54)) ((display . ":0.0") (top . 0) (left . 224) (width . 80) (height . 54))))) (defun mozmacmini-osx-frames () "Arrange frames for working on Mac Mini from Mozilla under OSX." (interactive) (fresh-frame-set '(((top . 0) (left . 712) (width . 80) (height . 62)) ((top . 0) (left . 1314) (width . 79) (height . 62))))) (defun jimb-current-frame-set () "Return what fresh-frame-set expects to recreate the current frame set. This has hard-coded some values for the window decoration sizes; these are probably specific to the window manager and theme." ;; First, get the current parameters, selecting only those we care about. (let* ((s (mapcar (lambda (f) (let ((p (frame-parameters f))) (mapcar (lambda (n) (assq n p)) '(display top left width height)))) (frame-list))) ;; Then, adjust the top and left. (s (mapcar (lambda (ps) (mapcar (lambda (p) (let ((v (cdr p))) (case (car p) ((top) '(top . 0)) ((left) (cons 'left (- v 5))) (t p)))) ps)) s))) s)) (provide 'jimb-frames)