Subject: FVWM: Dynamic menu titles

From: Micha Feigin <[email-masked]>
Date: Sun, 7 Dec 2003 17:12:03 +0200

Is it possible to produce a menu title or entry from an external
command on a statically created menu?
For example is it possible to have the menu title or entry show the
current time and date in the menu instead of using a pop up window.
--
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: Sun, 7 Dec 2003 17:29:24 +0000

> current time and date in the menu instead of using a pop up window.

I assume you can read about really dynamical submenus in the man page.

Here is one way to have a partially dynamical menu you want:

  DestroyFunc ShowTimeTitledMenu
  AddToFunc   ShowTimeTitledMenu
  + I DestroyMenu TimeTitledMenu
  + I AddToFunc   TimeTitledMenu
  + I Echo PipeRead `date +'+ "%d-%b-%Y %T" Title'`
  + I + I "item 1 in your menu" Exec command 1
  + I + I "item 2 in your menu" Exec command 2
  + I Menu TimeTitledMenu

Now, every time you want to show your menu with the current time title,
use "ShowTimeTitledMenu" function in place of "Menu" command.

Regards,
Mikhael.

---

From: Mikhael Goikhman <[email-masked]>
Date: Sun, 7 Dec 2003 17:35:17 +0000

>   + I + I "item 2 in your menu" Exec command 2

Ok, this obviously contains 3 small typos, here is the correct version,
(this time I actually pasted this into FvwmConsole to see it works):

  DestroyFunc ShowTimeTitledMenu
  AddToFunc   ShowTimeTitledMenu
  + I DestroyMenu TimeTitledMenu
  + I AddToMenu   TimeTitledMenu
  + I PipeRead `date +'+ "%d-%b-%Y %T" Title'`
  + I + "item 1 in your menu" Exec command 1
  + I + "item 2 in your menu" Exec command 2
  + I Menu TimeTitledMenu

Regards,
Mikhael.