Adapted from code as part of Herbert Jones’s StumpWM config and discussed on this thread at r/stumpwm.
Provides functions (and thus easy keybindings) to raise or hide windows in a split or as a floating window. For example, can have a keybinding to provide a terminal to execute quick commands and then hide it until needed again, or to show a chat program when needed.
Load it as a module after copying it somewhere, e.g. ~~/stumpwm~:
(set-module-dir "~/stumpwm")
(load-module "scratchpad")
Then can bind a key to run or raise a program, e.g. a floating termite window:
(defcommand scratchpad-term () ()
(scratchpad:toggle-floating-scratchpad "term" "termite"
:initial-gravity :center
:initial-width 1900
:initial-height 1200))
(define-key *top-map* (kbd "s-t") "scratchpad-term")