Add :maxsize windows in *default-managed-type*
[clfswm.git] / doc / dot-clfswmrc
blob7dc7adbd0d36ae21ec4851735af5ebdedad81fc5
1 ;;; -*- lisp -*-
2 ;;;
3 ;;; CLFSWM configuration file example
4 ;;;
5 ;;; Send me your configuration file at pbrochard _at_ common-lisp -dot- net
6 ;;; if you want to share it with others.
8 (in-package :clfswm)
12 ;;;; Uncomment the line above if you need default modifiers (or not)
13 ;;(with-capslock)
14 ;;(with-numlock)
15 ;;(without-capslock)
16 ;;(without-numlock)
18 ;;;; Uncomment the line above if you want to enable the notify event compression.
19 ;;;; This variable may be useful to speed up some slow version of CLX
20 ;;;; It is particulary useful with CLISP/MIT-CLX.
21 ;; (setf *have-to-compress-notify* t)
24 ;;; Color configuration example
25 ;;;
26 ;;; See in package.lisp or config.lisp for all variables
27 ;;(setf *color-unselected* "Blue")
30 ;;; How to change the default fullscreen size
31 ;;(defun get-fullscreen-size ()
32 ;;  "Return the size of root child (values rx ry rw rh)
33 ;;You can tweak this to what you want"
34 ;;  (values -2 -2 (+ (xlib:screen-width *screen*) 2) (- (xlib:screen-height *screen*) 20)))
37 ;;; Contributed code example
38 ;;; See in the clfswm/contrib directory to find some contributed code
39 ;;; and se load-contrib to load them. For example:
40 ;;(load-contrib "contrib-example.lisp")
42 ;;(load-contrib "mpd.lisp")
43 ;;(load-contrib "keyb_fr.lisp")
44 ;;(load-contrib "xmms.lisp")
45 ;;(load-contrib "cd-player.lisp")
46 ;;(load-contrib "reboot-halt.lisp")
49 ;;;; Client/server connection - the connection is crypted and you can only
50 ;;;; connect to the server with the same clfswm binary.
51 ;;(load-contrib "server/server.lisp")
52 ;;(unless (is-started-as-client-p)
53 ;;  (start-server))
57 ;;; Binding example: Undefine Control-F1 and define  Control-F5 as a
58 ;;; new binding in main mode
59 ;;;
60 ;;; See bindings.lisp, bindings-second-mode.lisp for all default bindings definitions.
62 ;;(defun $start-emacs ()
63 ;;  "Run or raise emacs"
64 ;;  (setf *second-mode-leave-function*
65 ;;        (lambda ()
66 ;;          (run-or-raise (lambda (win) (string-equal "emacs"
67 ;;                                                  (xlib:get-wm-class win)))
68 ;;                        (lambda () (do-shell "cd $HOME && exec emacsclient -c")))))
69 ;;  (leave-second-mode))
71 ;;(defun $start-conkeror ()
72 ;;  "Run or raise conkeror"
73 ;;  (setf *second-mode-leave-function*
74 ;;        (lambda ()
75 ;;          (run-or-raise (lambda (win) (string-equal "Navigator"
76 ;;                                                  (xlib:get-wm-class win)))
77 ;;                        (lambda () (do-shell "cd $HOME && exec conkeror")))))
78 ;;  (leave-second-mode))
80 ;;(defun binding-example ()
81 ;;  (undefine-main-key ("F1" :mod-1))
82 ;;  (define-main-key ("F5" :mod-1) 'help-on-clfswm)
83 ;;  (define-second-key ("e") '$start-emacs)
84 ;;  (define-second-key ("c") '$start-conkeror)
85 ;;  ;; Binding example for apwal
86 ;;  (define-second-key (#\Space)
87 ;;      (defun tpm-apwal ()
88 ;;      "Run Apwal"
89 ;;      (do-shell "exec apwal")
90 ;;      (show-all-windows-in-workspace (current-workspace))
91 ;;      (throw 'exit-second-loop nil))))
93 ;;(add-hook *binding-hook* 'binding-example)
96 ;;; Set up an UZBL frame where all uzbl windows will be absorbed.
97 ;;;
98 ;;(defun set-uzbl-frame-nw-hook (&optional (frame *current-child*))
99 ;;  "Open the window in the UZBL frame if it match uzbl absorb-nw-test"
100 ;;  (when (frame-p frame)
101 ;;    (setf (frame-nw-hook frame) 'absorb-window-nw-hook
102 ;;        (frame-data-slot frame :nw-absorb-test)  (nw-absorb-test-class "uzbl-core"))))
104 ;;#-:uzbl-menu-added
105 ;;(add-menu-key 'frame-nw-hook-menu "z" 'set-uzbl-frame-nw-hook)
107 ;;(pushnew :uzbl-menu-added *features*)
110 ;;(defun init-uzbl-frame ()
111 ;;  (let ((frame (first (frame-child *root-frame*))))
112 ;;    (setf (frame-data-slot frame :tile-size) 0.7)
113 ;;    (setf *current-child* frame)
114 ;;    (bind-on-slot 0)
115 ;;    (let ((uzbl-frame (create-frame :name "Uzbl" :x 0.01 :y 0.01 :w 0.98 :h 0.98)))
116 ;;      (add-frame uzbl-frame frame)
117 ;;      (set-uzbl-frame-nw-hook uzbl-frame))))
119 ;;(unless (member 'init-uzbl-frame *init-hook*)
120 ;;  (add-hook *init-hook* 'init-uzbl-frame))
121 ;;; End UZBL setup.
124 ;;; A more complex example I use to record my desktop and show
125 ;;; documentation associated to each key press.
126 ;;;See contrib/osd.lisp
127 ;;(load-contrib "osd.lisp")
128 ;;;;; -- Doc example end --
132 ;;;;; Init hook examples:
133 ;;(defun my-init-hook-1 ()
134 ;;  (dbg 'my-init-hook)
135 ;;  ;;(add-frame (create-frame :name "Default" :layout #'tile-left-layout :data (list '(:tile-size 0.6))) *root-frame*)
136 ;;  (add-frame (create-frame :name "The Gimp" :x 0.6 :y 0 :w 0.3 :h 0.2) *root-frame*)
137 ;;  (add-frame (create-frame :name "Net" :x 0.52 :y 0.3 :w 0.4 :h 0.3) *root-frame*)
138 ;;  (add-frame (create-frame :x 0.4 :y 0 :w 0.2 :h 0.3) (first (frame-child *root-frame*)))
139 ;;  (add-frame (create-frame :x 0.6 :y 0.4 :w 0.4 :h 0.2) (first (frame-child *root-frame*)))
140 ;;  (add-frame (create-frame :x 0.4 :y 0.7 :w 0.2 :h 0.3) (first (frame-child *root-frame*)))
141 ;;  (let ((frame (create-frame :name "The Qiv" :x 0 :y 0.4 :w 0.4 :h 0.2)))
142 ;;    (add-frame frame (first (frame-child *root-frame*)))
143 ;;    (add-frame (create-frame) frame))
144 ;;  (add-frame (create-frame :x 0.1 :y 0.55 :w 0.8 :h 0.43) *root-frame*)
145 ;;  (add-frame (create-frame :x 0.2 :y 0.1 :w 0.6 :h 0.4) (first (frame-child *root-frame*)))
146 ;;  (add-frame (create-frame :x 0.3 :y 0.55 :w 0.4 :h 0.3) (first (frame-child *root-frame*)))
147 ;;  (add-frame (create-frame :x 0.1 :y 0.1 :w 0.3 :h 0.6) (first (frame-child (first (frame-child *root-frame*)))))
148 ;;  (setf (frame-layout *current-child*) #'tile-layout))
150 ;;(defun my-init-hook-2 ()
151 ;;  (dbg 'my-init-hook)
152 ;;  (add-frame (create-frame :name "Default" :layout #'tile-left-layout :data (list '(:tile-size 0.6))) *root-frame*)
153 ;;  (setf (frame-layout *current-child*) #'tile-layout))
156 ;;(defun my-init-hook-3 ()
157 ;;  (dbg 'my-init-hook)
158 ;;  (add-frame (create-frame :name "plop" :x 0.1 :y 0.4 :w 0.7 :h 0.3) *root-frame*)
159 ;;  (add-frame (create-frame :name "Default" :layout nil :x 0.1 :y 0.5 :w 0.8 :h 0.5)
160 ;;           *root-frame*)
161 ;;  (setf (frame-layout *root-frame*) nil))
165 ;;(defun my-init-hook-4 ()
166 ;;  (let ((frame (add-frame (create-frame :name "Default"
167 ;;                                        :layout #'tile-left-layout
168 ;;                                      :x 0.05 :y 0.05 :w 0.9 :h 0.9)
169 ;;                        *root-frame*)))
170 ;;    (setf *current-child* frame)))
173 ;;;;; Use this hook and prevent yourself to create a new frame to emulate
174 ;;;;; the MS Windows desktop style :)
175 ;;(defun my-init-hook-ms-windows-style ()
176 ;;  (setf (frame-managed-type *root-frame*) nil))
179 ;;;;; Here is another example useful with the ROX filer: Only the
180 ;;;;; root frame fullscreen with some space on the left for icons.
181 ;;(defun my-init-hook-rox-filer ()
182 ;;  (setf (frame-layout *root-frame*) #'tile-left-space-layout
183 ;;      (frame-data-slot *root-frame* :tile-size) 0.9))
188 ;;(setf *init-hook* '(my-init-hook-4))  ;; <- choose one in 1 to 4,
189 ;;;;                                             my-init-hook-ms-windows-style
190 ;;;;                                             my-init-hook-rox-filer
191 ;;;;(setf *init-hook* nil)
192 ;;;;; Init hook end
195 ;;; For debuging: start another sever (for example: 'startx -- :1'), Xnest
196 ;;; or Zephyr and add the lines above in a dot-clfswmrc-debug file
197 ;;; mod-2 is the numlock key on some keyboards.
198 ;;(setf *default-modifiers* '(:mod-2))
200 ;;(defun my-add-escape ()
201 ;;  (define-main-key ("Escape" :mod-2) 'exit-clfswm))
203 ;;(add-hook *binding-hook* 'my-add-escape)
205 ;;(clfswm:main :display ":1" :alternate-conf #P"/where/is/dot-clfswmrc-debug")