stumpwm-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Show modeline when super key is pressed


From: Ruthard Baudach
Subject: Re: Show modeline when super key is pressed
Date: Sat, 30 Nov 2024 07:53:23 +0100
User-agent: K-9 Mail for Android

Disclaimer: I set up my stumpwm config in another time and age and never touched it again.

I just mapped a command (I'm pretty sure it's handily named toggle-modeline or similar, it used to be in the manual) to the key of my choice. This doesn't float the modeline, though. But if you are able to write a command that floats the modeline, why bother with key events instead of using a regular key mapping?

Oh – I get it! You cannot map to modifier keys. It might be easier to remap the key of your choice (super key) to some key symbol you can use to map to a command, like e.g. F20 using the remapping tool of your display manager. I'm remapping super as well in my stumpwmrc, using xmodmap. If I remember correctly, that used to be the method recommended by the manual.

Might be more fun doing this in lisp, if course.

Good luck!

R.


Am 24. November 2024 20:31:29 MEZ schrieb Daniel Radetsky <dradetsky@gmail.com>:
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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]