Subject: FVWM: changing the RootMenu dynamicaly

From: Klaus Umbach <[email-masked]>
Date: Wed, 14 Jan 2004 08:25:45 +0100

Hello list,

is it possible, to change the RootMenu dynamicaly?
I want applications, that are already started and must not be started
a second time, like gaim and xmms to disappear in my RootMenu.
I tried

Piperead 'if ps aux | grep treibho | grep gaim | grep -v grep > /dev/null; then echo "+ \"ICQ%\$[HOME]/.fvwm/icons/36x36/apps/licq.png%\"      Exec gaim"; fi'

but that seems not to work. Any ideas?

Regards
	Klaus

--
5) People say Linux is ugly. How does that make you feel?
Torvalds: They'll be the first against the wall when the revolution comes.
	  Let's see just how ugly they think it is when they have a few
	  bulletholes in them.

--
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: Micha Feigin <[email-masked]>
Date: Wed, 14 Jan 2004 10:03:49 +0200

> but that seems not to work. Any ideas?

I got things right, piperead creates the menu only once. You need to
explicitly destroy and recreate the menu each time (or when relevant).
Here is an example of what I use to create a dynamic unread mail status
menu (if anyone is interested in the script itself, mail me. Its not
very efficient and it only handles Maildirs, but it works ;-)

DestroyMenu Mail
AddToMenu Mail Mail Title
+ DynamicPopUpAction	Function read-mail-dir

DestroyFunc read-mail-dir
AddToFunc read-mail-dir
+ I DestroyMenu Mail
+ I AddToMenu Mail "Mail" Title
+ I PipeRead '~/.fvwm/maildir_status.sh ~/Maildir'
+ I AddToMenu Mail DynamicPopDownAction Function destroy-mail-dir

DestroyFunc destroy-mail-dir
AddToFunc destroy-mail-dir
+ I DestroyMenu Mail
+ I AddToMenu Mail "Mail" Title
+ I AddToMenu Mail DynamicPopUpAction Function read-mail-dir