Skip to content

Instantly share code, notes, and snippets.

@zc00gii
Created September 22, 2010 18:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zc00gii/592274 to your computer and use it in GitHub Desktop.
Save zc00gii/592274 to your computer and use it in GitHub Desktop.
(defmacro define-awesome-function (function args)
(if (null args)
`(defun ,function ()
,(multiple-value-bind (name) (read-from-string
(format "(slime-eval '(cl-awesome::%s))" function)) name))
`(defun ,function ,args
,(multiple-value-bind (name) (read-from-string
(format "(slime-eval `(cl-awesome::%s %s))" function
(let ((return-string ""))
(loop for i in args do
(setq return-string
(format "%s ,%s" return-string i)))
return-string))) name))))
(define-awesome-function run-raw-lua (lua))
(define-awesome-function toggle-awesome-menu ())
(define-awesome-function restart-awesome ())
(define-awesome-function quit-awesome ())
(define-awesome-function go-to-workspace (number))
(define-awesome-function move-to-workspace (number))
(define-awesome-function toggle-workspace (number))
(define-awesome-function switch-window (which-way))
(define-awesome-function move-mouse-and-focus (where))
(define-awesome-function move-window (where))
(define-awesome-function toggle-maximize-window ())
(define-awesome-function toggle-fullscreen-window ())
(loop for i in '(1 2 3 4 5 6 7 8) do (global-set-key (eval `(kbd ,(format "C-x 4 %s" i)))
`(lambda ()
(interactive)
(make-frame)
(move-to-workspace ,i))))
(provide 'awesome)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment