Adds a list of default commands.

This commit is contained in:
Florian MARGAINE 2015-10-01 14:55:55 +02:00
parent c92dc3c88c
commit 73739fbc34
No known key found for this signature in database
GPG key ID: 843F6D753D94972A
3 changed files with 36 additions and 6 deletions

View file

@ -27,13 +27,14 @@ needs to hook into stumpwm to dump layouts.
You *have* to add the hooks yourself.
Here are the minimum hooks you want to add:
For convenience, =winner-mode= provides a list of commands in
=winner-mode:*default-commands*=, so you can just add this hook to
start off:
#+BEGIN_SRC lisp
(add-hook *new-frame-hook* #'winner-mode:dump-group-to-file)
(add-hook *new-window-hook* #'winner-mode:dump-group-to-file)
(add-hook *destroy-window-hook* #'winner-mode:dump-group-to-file)
(add-hook *place-window-hook* #'winner-mode:dump-group-to-file)
(add-hook *post-command-hook* (lambda (command)
(when (member command winner-mode:*default-commands*)
(winner-mode:dump-group-to-file))))
#+END_SRC
** Example

View file

@ -1,3 +1,3 @@
(defpackage #:winner-mode
(:use :cl)
(:export :winner-undo :winner-redo :*tmp-folder* :dump-group-to-file))
(:export :winner-undo :winner-redo :*tmp-folder* :dump-group-to-file :*default-commands*))

View file

@ -3,3 +3,32 @@
(defvar *current-ids* (make-hash-table))
(defvar *max-ids* (make-hash-table))
(defvar *tmp-folder* #p"/tmp/")
(defvar *default-commands*
'(stumpwm:only
stumpwm:pull-from-windowlist
stumpwm:pull-hidden-next
stumpwm:pull-hidden-other
stumpwm:pull-hidden-previous
stumpwm:pull-marked
stumpwm:pull-window-by-number
stumpwm:next
stumpwm:next-in-frame
stumpwm:next-urgent
stumpwm:prev
stumpwm:prev-in-frame
stumpwm:select-window
stumpwm:select-from-menu
stumpwm:select-window-by-name
stumpwm:select-window-by-number
stumpwm::pull
stumpwm::remove
stumpwm:iresize
stumpwm:vsplit
stumpwm:hsplit
stumpwm:move-window
stumpwm:move-windows-to-group
stumpwm:move-window-to-group
stumpwm:balance-frames
stumpwm::delete
stumpwm::kill
stumpwm:fullscreen))