Skip to content

Latest commit

 

History

History
56 lines (39 loc) · 1.47 KB

README.org

File metadata and controls

56 lines (39 loc) · 1.47 KB

winner-mode

Usage

This only works per group.

Put:

(load-module "winner-mode")

In your ~/.stumpwmrc, then the winner-undo and winner-redo commands will be available. I recommend binding these keys like this:

(defvar *winner-map* (make-sparse-keymap))

(define-key *root-map* (kbd "c") '*winner-map*)

(define-key *winner-map* (kbd "Left") "winner-undo")
(define-key *winner-map* (kbd "Right") "winner-redo")

winner-mode works by dumping layouts and restoring them. It means it needs to hook into stumpwm to dump layouts.

You have to add the hooks yourself.

For convenience, winner-mode provides a list of commands in winner-mode:*default-commands*, so you can just add this hook to start off:

(add-hook *post-command-hook* (lambda (command)
                                (when (member command winner-mode:*default-commands*)
                                  (winner-mode:dump-group-to-file))))

Example

  • Be with 4 frames
  • Hit C-t Q (aka only) to have a single one
  • Hit C-t c <left-arrow> to go back to the 4-frames setup
  • Hit C-t c <right-arrow> to go back to the 1-frame setup

API

By default, winner-mode stores dumps of layouts in /tmp/. If you want to change this folder, you can override winner-mode:*tmp-folder*, e.g.:

(load-module "winner-mode")
(setf winner-mode:*tmp-folder* (merge-pathnames #p"tmp/" (user-homedir-pathname)))