Re: Show modeline when super key is pressed

Ruthard Baudach <[email protected]> Sat, 30 Nov 2024 07:53:23 +0100
Newsgroups gmane.comp.window-managers.stumpwm.devel
Message-ID <[email protected]>
------HVDI7G709MMU19Q9CL2RZXLCRV668N
Content-Type: text/plain;
 charset=utf-8
Content-Transfer-Encoding: quoted-printable

Disclaimer: I set up my stumpwm config in another time and age and never to=
uched it again=2E

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

Oh =E2=80=93 I get it! You cannot map to modifier keys=2E It might be easi=
er to remap the key of your choice (super key) to some key symbol you can u=
se to map to a command, like e=2Eg=2E F20 using the remapping tool of your =
display manager=2E I'm remapping super as well in my stumpwmrc, using xmodm=
ap=2E If I remember correctly, that used to be the method recommended by th=
e manual=2E

Might be more fun doing this in lisp, if course=2E

Good luck!

R=2E

Am 24=2E November 2024 20:31:29 MEZ schrieb Daniel Radetsky <dradetsky@gma=
il=2Ecom>:
>I'm currently messing around with Stumpwm to see if it's
>suitable for me and/or worth switching to=2E 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=2E
>
>Here's what I'd like to do:
>
>1=2E Show the modeline only when some key is held down (in
>this case, the super key)=2E
>
>2=2E When the modeline appears, it should not resize the other
>windows to fit it, but float over the top of them=2E
>
>So basically, the modeline would be invisible (and consume
>no screen space) normally=2E 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=2E
>
>So far, it looks like in theory this is something you would
>do at the level of the event handler=2E However, if I
>understand correctly, each type of event is only bound to
>one single event-handler=2E Currently, there is a default
>handler bound to :key-press (which looks up the key it got),
>and no handler bound to :key-release=2E
>
>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=2E Then we add a new handler for :key-release which
>checks whether the key is super, in which case we deactivate
>the mode-line=2E And then we worry about making it float
>later=2E
>
>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)=2E
>
>Anyway, any guidance on this would be much appreciated=2E
>
>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=2E But if not it's not the end of the world=2E
>
>--dmr
>
>[^1]: Although if I understand correctly, the default is to
>do nothing, because we skip processing modifier keys
>directly=2E
>

------HVDI7G709MMU19Q9CL2RZXLCRV668N
Content-Type: text/html;
 charset=utf-8
Content-Transfer-Encoding: quoted-printable

<html><head></head><body><div dir=3D"auto">Disclaimer: I set up my stumpwm =
config in another time and age and never touched it again=2E<br><br>I just =
mapped a command (I'm pretty sure it's handily named toggle-modeline or sim=
ilar, it used to be in the manual) to the key of my choice=2E This doesn't =
float the modeline, though=2E But if you are able to write a command that f=
loats the modeline, why bother with key events instead of using a regular k=
ey mapping?<br><br>Oh =E2=80=93 I get it! You cannot map to modifier keys=
=2E 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=2Eg=2E F20 using the rem=
apping tool of your display manager=2E I'm remapping super as well in my st=
umpwmrc, using xmodmap=2E If I remember correctly, that used to be the meth=
od recommended by the manual=2E<br><br>Might be more fun doing this in lisp=
, if course=2E<br><br>Good luck!<br><br>R=2E</div><br><br><div class=3D"gma=
il_quote"><div dir=3D"auto">Am 24=2E November 2024 20:31:29 MEZ schrieb Dan=
iel Radetsky &lt;dradetsky@gmail=2Ecom&gt;:</div><blockquote class=3D"gmail=
_quote" style=3D"margin: 0pt 0pt 0pt 0=2E8ex; border-left: 1px solid rgb(20=
4, 204, 204); padding-left: 1ex;">
<pre class=3D"k9mail"><div dir=3D"auto">I'm currently messing around with =
Stumpwm to see if it's<br>suitable for me and/or worth switching to=2E Ther=
e's one<br>feature that I'd really like to have in my window manager,<br>an=
d I wonder if it's possible in Stumpwm, either currently<br>or with minimal=
 hacking=2E<br><br>Here's what I'd like to do:<br><br>1=2E Show the modelin=
e only when some key is held down (in<br>this case, the super key)=2E<br><b=
r>2=2E When the modeline appears, it should not resize the other<br>windows=
 to fit it, but float over the top of them=2E<br><br>So basically, the mode=
line would be invisible (and consume<br>no screen space) normally=2E Howeve=
r, when I'm in the middle<br>of performing some kind of window manager-leve=
l operation<br>(like deciding to switch to a different workspace), the<br>m=
odeline would be visible, and it wouldn't really matter<br>that it was cove=
ring up content=2E<br><br>So far, it looks like in theory this is something=
 you would<br>do at the level of the event handler=2E However, if I<br>unde=
rstand correctly, each type of event is only bound to<br>one single event-h=
andler=2E Currently, there is a default<br>handler bound to :key-press (whi=
ch looks up the key it got),<br>and no handler bound to :key-release=2E<br>=
<br>So if I wanted to do this, I would have to modify the<br>default :key-p=
ress handler to check for a specific condition<br>(if the key press is the =
super key), in which case we<br>execute some specific code (in this case, a=
ctivate the<br>mode-line) before continuing with the default handler<br>cod=
e^1=2E Then we add a new handler for :key-release which<br>checks whether t=
he key is super, in which case we deactivate<br>the mode-line=2E And then w=
e worry about making it float<br>later=2E<br><br>Unfortunately, I tried to =
just add a trivial handler to<br>init:<br><br>(stumpwm::define-stump-event-=
handler :key-release (code state)<br>  (dformat 1 "dformat got :key-release=
 event: ~a | ~a" code state)<br>  (message "got :key-release event: ~a | ~a=
" code state))<br><br>and didn't manage to generate any output, although I'=
m<br>probably doing something wrong (I haven't done any common<br>lisp for =
a while)=2E<br><br>Anyway, any guidance on this would be much appreciated=
=2E<br><br>Also FWIW, I'm currently testing &amp; configuring Stumpwm from<=
br>within Xephyr and using meta as my leader key (so it doesn't<br>conflict=
 with my current wm, notion), so ideally any<br>solution would be flexible =
enough to be swapped in &amp; out of<br>that setup=2E But if not it's not t=
he end of the world=2E<br><br>--dmr<br><br>[^1]: Although if I understand c=
orrectly, the default is to<br>do nothing, because we skip processing modif=
ier keys<br>directly=2E<br><br></div></pre></blockquote></div></body></html=
>
------HVDI7G709MMU19Q9CL2RZXLCRV668N--