Show modeline when super key is pressed
Daniel Radetsky <[email protected]> Sun, 24 Nov 2024 11:31:29 -0800
| Newsgroups | gmane.comp.window-managers.stumpwm.devel |
|---|---|
| Message-ID | <t7khkhjs2mts4lscfmcbt3iudkvp52hizyj45ymytmor6l6zkq@usymu4daljfj> |
I'm currently messing around with Stumpwm to see if it's suitable for me and/or worth switching to. There's one feature that I'd really like to have in my window manager, and I wonder if it's possible in Stumpwm, either currently or with minimal hacking. Here's what I'd like to do: 1. Show the modeline only when some key is held down (in this case, the super key). 2. When the modeline appears, it should not resize the other windows to fit it, but float over the top of them. So basically, the modeline would be invisible (and consume no screen space) normally. However, when I'm in the middle of performing some kind of window manager-level operation (like deciding to switch to a different workspace), the modeline would be visible, and it wouldn't really matter that it was covering up content. So far, it looks like in theory this is something you would do at the level of the event handler. However, if I understand correctly, each type of event is only bound to one single event-handler. Currently, there is a default handler bound to :key-press (which looks up the key it got), and no handler bound to :key-release. So if I wanted to do this, I would have to modify the default :key-press handler to check for a specific condition (if the key press is the super key), in which case we execute some specific code (in this case, activate the mode-line) before continuing with the default handler code^1. Then we add a new handler for :key-release which checks whether the key is super, in which case we deactivate the mode-line. And then we worry about making it float later. Unfortunately, I tried to just add a trivial handler to init: (stumpwm::define-stump-event-handler :key-release (code state) (dformat 1 "dformat got :key-release event: ~a | ~a" code state) (message "got :key-release event: ~a | ~a" code state)) and didn't manage to generate any output, although I'm probably doing something wrong (I haven't done any common lisp for a while). Anyway, any guidance on this would be much appreciated. Also FWIW, I'm currently testing & configuring Stumpwm from within Xephyr and using meta as my leader key (so it doesn't conflict with my current wm, notion), so ideally any solution would be flexible enough to be swapped in & out of that setup. But if not it's not the end of the world. --dmr [^1]: Although if I understand correctly, the default is to do nothing, because we skip processing modifier keys directly.