Subject: FVWM: Changing menu entries while up w/ modifiers

From: Chris Ross <[email-masked]>
Date: Thu, 21 Aug 2003 12:58:15 -0400

Hi there.  I am wondering if it's possible to do
something with fvwm (2.4.4 currently installed).
I would like to have menu entries that perform
different actions based on modifiers.  Ideally,
they would also change their displayed text when
the modifier changed.

   So, I could have a menu of hosts to telnet to,
but when I pressed "Shift", the labels would all
change to "<host> (ssh)" rather than "<host>".
And if I selected that entry while the modifier
was held, it would ssh to it instead.  They
would of course be able to do *any* other action,
but this is the sort of place I'd expect to
want to do this.

   Does fvwm allow for this?  I'm 90% sure I've seen
some window manager or another that can do this.
Maybe it was enlightenment.  I don't recall.  But
I'm using fvwm now, and content to stay with it,
but this would be a really nice feature to keep
my menus smaller on screen, but have additional
options for the occasions that I need them.

   Thanks.

                          - Chris

--
Chris Ross
[email-masked]

--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Mikhael Goikhman <[email-masked]>
Date: Thu, 21 Aug 2003 20:48:14 +0300

> but this is the sort of place I'd expect to

This is not currently possible. But why don't you just define 2 menu
versions (they will be more readable then one bulky menu you suggest)
and fire them on different key bindings (for example one with Alt-F5
and another with Shift-F5):

  Key F5 A M Menu MySSHMenu
  Key F5 A S Menu MyTelnetMenu

With small tricks you may even define only one menu version, like this:

  Key F5 A M OpenMySSHMenu
  Key F5 A A OpenMyTelnetMenu

  AddToFunc OpenMySSHMenu
  + I DestroyFunc MyRemoteCommand
  + I AddToFunc   MyRemoteCommand
  + I + I Exec xterm -g 80x40 -bg darkred -e ssh $$0
  + I Menu MyShells

  AddToFunc OpenMyTelnetMenu
  + I DestroyFunc MyRemoteCommand
  + I AddToFunc   MyRemoteCommand
  + I + I Exec xterm -g 80x40 -bg darkgreen -e telnet $$0
  + I Menu MyShells

And the actual menu would look like this:

  AddToMenu MyShells
  + "%rterm.xpm%Poseidon" MyRemoteCommand poseidon
  + "%polar.xpm%Polaris"  MyRemoteCommand polaris
  ...

Not tested, but this technique should work.

Regards,
Mikhael.

---

From: Chris Ross <[email-masked]>
Date: Thu, 21 Aug 2003 14:20:49 -0400

>  Key F5 A S Menu MyTelnetMenu

  This would work.  It isn't ideal. but...  The comments on
complexity below still apply, however.

>[...]

  That wouldn't work for me, really.  I don't want to change *all* of
the items in the menu.  Just one or two.  So, that would be a heck of
a lot of work just for part of a menu.  I guess that it actually would
*work*, but is a lot of effort.

  Also, any of this would only allow me to get it if I thought of
it before opening the menu or submenu.  And because I have
all of this built with M4 anyway, it'd be much more complicated
to do it that way.

  Can I request that this sort of feature be added in the future?
Having the menu entries change when modifiers are activated
and disactivated is kinda difficult, and configuring it is no small
feat either, but...  It would be very useful in the situations where
it's desired.  And doesn't hurt anything (except total code size
I guess) when it's not used...

                                             - Chris