| 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. |
| 7 |
|
| 8 |
(in-package :clfswm) |
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
;;;; Uncomment the line above if you need default modifiers (or not) |
| 13 |
;;(with-capslock) |
| 14 |
;;(with-numlock) |
| 15 |
;;(without-capslock) |
| 16 |
;;(without-numlock) |
| 17 |
|
| 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) |
| 22 |
|
| 23 |
|
| 24 |
;;; Color configuration example |
| 25 |
;;; |
| 26 |
;;; See in package.lisp or config.lisp for all variables |
| 27 |
;;(setf *color-unselected* "Blue") |
| 28 |
|
| 29 |
|
| 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))) |
| 35 |
|
| 36 |
|
| 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") |
| 41 |
|
| 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") |
| 47 |
|
| 48 |
|
| 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)) |
| 54 |
|
| 55 |
|
| 56 |
|
| 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. |
| 61 |
;; |
| 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)) |
| 70 |
;; |
| 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)) |
| 79 |
;; |
| 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)))) |
| 92 |
;; |
| 93 |
;;(add-hook *binding-hook* 'binding-example) |
| 94 |
|
| 95 |
|
| 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")))) |
| 103 |
;; |
| 104 |
;;#-:uzbl-menu-added |
| 105 |
;;(add-menu-key 'frame-nw-hook-menu "z" 'set-uzbl-frame-nw-hook) |
| 106 |
;; |
| 107 |
;;(pushnew :uzbl-menu-added *features*) |
| 108 |
;; |
| 109 |
;; |
| 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-root* frame |
| 114 |
;; *current-child* frame) |
| 115 |
;; (bind-on-slot 0) |
| 116 |
;; (let ((uzbl-frame (create-frame :name "Uzbl" :x 0.01 :y 0.01 :w 0.98 :h 0.98))) |
| 117 |
;; (add-frame uzbl-frame frame) |
| 118 |
;; (set-uzbl-frame-nw-hook uzbl-frame)))) |
| 119 |
;; |
| 120 |
;;(unless (member 'init-uzbl-frame *init-hook*) |
| 121 |
;; (add-hook *init-hook* 'init-uzbl-frame)) |
| 122 |
;;; End UZBL setup. |
| 123 |
|
| 124 |
|
| 125 |
;;; A more complex example I use to record my desktop and show |
| 126 |
;;; documentation associated to each key press. |
| 127 |
;;;See contrib/osd.lisp |
| 128 |
;;(load-contrib "osd.lisp") |
| 129 |
;;;;; -- Doc example end -- |
| 130 |
|
| 131 |
|
| 132 |
|
| 133 |
;;;;; Init hook examples: |
| 134 |
;;(defun my-init-hook-1 () |
| 135 |
;; (dbg 'my-init-hook) |
| 136 |
;; ;;(add-frame (create-frame :name "Default" :layout #'tile-left-layout :data (list '(:tile-size 0.6))) *root-frame*) |
| 137 |
;; (add-frame (create-frame :name "The Gimp" :x 0.6 :y 0 :w 0.3 :h 0.2) *root-frame*) |
| 138 |
;; (add-frame (create-frame :name "Net" :x 0.52 :y 0.3 :w 0.4 :h 0.3) *root-frame*) |
| 139 |
;; (add-frame (create-frame :x 0.4 :y 0 :w 0.2 :h 0.3) (first (frame-child *root-frame*))) |
| 140 |
;; (add-frame (create-frame :x 0.6 :y 0.4 :w 0.4 :h 0.2) (first (frame-child *root-frame*))) |
| 141 |
;; (add-frame (create-frame :x 0.4 :y 0.7 :w 0.2 :h 0.3) (first (frame-child *root-frame*))) |
| 142 |
;; (let ((frame (create-frame :name "The Qiv" :x 0 :y 0.4 :w 0.4 :h 0.2))) |
| 143 |
;; (add-frame frame (first (frame-child *root-frame*))) |
| 144 |
;; (add-frame (create-frame) frame)) |
| 145 |
;; (add-frame (create-frame :x 0.1 :y 0.55 :w 0.8 :h 0.43) *root-frame*) |
| 146 |
;; (add-frame (create-frame :x 0.2 :y 0.1 :w 0.6 :h 0.4) (first (frame-child *root-frame*))) |
| 147 |
;; (add-frame (create-frame :x 0.3 :y 0.55 :w 0.4 :h 0.3) (first (frame-child *root-frame*))) |
| 148 |
;; (add-frame (create-frame :x 0.1 :y 0.1 :w 0.3 :h 0.6) (first (frame-child (first (frame-child *root-frame*))))) |
| 149 |
;; (setf *current-child* (first (frame-child *current-root*))) |
| 150 |
;; (setf (frame-layout *current-child*) #'tile-layout)) |
| 151 |
;; |
| 152 |
;;(defun my-init-hook-2 () |
| 153 |
;; (dbg 'my-init-hook) |
| 154 |
;; (add-frame (create-frame :name "Default" :layout #'tile-left-layout :data (list '(:tile-size 0.6))) *root-frame*) |
| 155 |
;; (setf *current-child* (first (frame-child *current-root*))) |
| 156 |
;; (setf (frame-layout *current-child*) #'tile-layout)) |
| 157 |
;; |
| 158 |
;; |
| 159 |
;;(defun my-init-hook-3 () |
| 160 |
;; (dbg 'my-init-hook) |
| 161 |
;; (add-frame (create-frame :name "plop" :x 0.1 :y 0.4 :w 0.7 :h 0.3) *root-frame*) |
| 162 |
;; (add-frame (create-frame :name "Default" :layout nil :x 0.1 :y 0.5 :w 0.8 :h 0.5) |
| 163 |
;; *root-frame*) |
| 164 |
;; (setf *current-child* (first (frame-child *current-root*))) |
| 165 |
;; (setf (frame-layout *root-frame*) nil)) |
| 166 |
;; |
| 167 |
;; |
| 168 |
;; |
| 169 |
;;(defun my-init-hook-4 () |
| 170 |
;; (let ((frame (add-frame (create-frame :name "Default" |
| 171 |
;; :layout #'tile-left-layout |
| 172 |
;; :x 0.05 :y 0.05 :w 0.9 :h 0.9) |
| 173 |
;; *root-frame*))) |
| 174 |
;; (setf *current-child* frame))) |
| 175 |
;; |
| 176 |
;; |
| 177 |
;;;;; Use this hook and prevent yourself to create a new frame to emulate |
| 178 |
;;;;; the MS Windows desktop style :) |
| 179 |
;;(defun my-init-hook-ms-windows-style () |
| 180 |
;; (setf (frame-managed-type *root-frame*) nil)) |
| 181 |
;; |
| 182 |
;; |
| 183 |
;;;;; Here is another example useful with the ROX filer: Only the |
| 184 |
;;;;; root frame fullscreen with some space on the left for icons. |
| 185 |
;;(defun my-init-hook-rox-filer () |
| 186 |
;; (setf (frame-layout *root-frame*) #'tile-left-space-layout |
| 187 |
;; (frame-data-slot *root-frame* :tile-size) 0.9)) |
| 188 |
;; |
| 189 |
;; |
| 190 |
;; |
| 191 |
;; |
| 192 |
;;(setf *init-hook* '(my-init-hook-4)) ;; <- choose one in 1 to 4, |
| 193 |
;;;; my-init-hook-ms-windows-style |
| 194 |
;;;; my-init-hook-rox-filer |
| 195 |
;;;;(setf *init-hook* nil) |
| 196 |
;;;;; Init hook end |