[clfswm-devel] Clfswmrc

Philippe Brochard pbrochard at common-lisp.net
Mon Jan 16 21:31:23 UTC 2012


Valentin Plechinger writes:

> https://github.com/floresconlimon/Dotfiles/blob/8cd24f970a07ab3ac6bd03804aed2293fe9865cd/clfswmrc
>
> Here is what I have so far.
> Mainly ripped of from Ales.
>
> One thing I added which I think is useful, is a macro to define
> keybindings "easier".
> Might be good for people who like to change alot of keybindings (like me).
>
I like your defkeys-main. But what about the definition above which let
you change the mode easily?

--------------------------------------------------
(defmacro defkeys ((mode) &body keys)
  (let ((symb (intern (format nil "DEFINE-~A-KEY" mode))))
    `(progn
       ,@(loop for k in keys collect `(,symb , at k)))))

(defun set-some-keys ()
  (defkeys (main)
    (("f" :mod-1) 'start-emacs)
    (("l" :mod-1) 'expose-all-windows-mode)
    (("u" :mod-1) 'expose-windows-mode)
    (("w" :mod-4) 'start-firefox)
    (("Return" :mod-4) 'start-urxvt))
  (defkeys (second)
    (("l" :mod-1) 'expose-all-windows-mode)
    (("u" :mod-1) 'expose-windows-mode)
    (("Return" :mod-4) 'start-urxvt)))
--------------------------------------------------




More information about the clfswm-devel mailing list