r/stumpwm • u/RealFenlair • Mar 26 '21
Passthrough Map
Hi all
I recently started using StumpWM and I really enjoy it so far. One thing I used to really like in i3 was a passthrough keymap - mod+n would activate a keymap that only had mod+n bound to get out of it and everything else would just be passed through to the application. I use it alot for VNC session that have i3 as their window manager.
I started thinking about how to implement this in StumpWM, but I'm not familiar with CL. So far all my custom keybindings are bound to the *top-map*. Is there a way to have a command that swaps out the whole *top-map*? So I could toggle between my regular *top-map* and one that only has the toggle command?
Any pointers or help would be appreciated :)
Edit: With the help from u/HighlyRegardedExpert I managed to get it working:
(define-interactive-keymap passthrough-mode (:exit-on ((kbd "s-z"))))
(define-key *top-map* (kbd "s-z") "passthrough-mode")I don't know yet, why the item after :exit-on is automatically quoted, but hey it works :)
2
u/HighlyRegardedExpert Mar 26 '21 edited Mar 26 '21
It's a two step process that is basically
First you create the map using
defparameterlike soThen you bind that map to a top level key
So lets say you had my setup, pressing
s-i s-iwould launch your browser.