Subject: FVWM: feature request: toggle command

From: Neil Zanella <[email-masked]>
Date: Mon, 7 Dec 1998 11:31:43 -0330 (NST)

Feature request for Fvwm2:

Toggle command1 command2
   Executes command1 when invoked, then command2 when invoked the next time,
   then command1 when invked the next time and so on...
   Commands containing spaces must be quoted.

Examples:

AddToMenu Modules "FvwmButtons" Toggle "Module FvwmButtons" "KillModule FvwmButtons"
+                 "FvwmPager"   Toggle "Module FvwmPager"   "KillModule FvwmPager" 
etc...

Best Regards,

Neil
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
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: Dominik Vogt <[email-masked]>
Date: Mon, 7 Dec 1998 16:11:08 +0100

> +                 "FvwmPager"   Toggle "Module FvwmPager"   "KillModule FvwmPager" 

I need that myself quite often. What I do is (on Linux):

  AddToMenu Modules "FvwmPager" Exec "killall FvwmPager || FvwmCommand FvwmPager"

That's not nice and requires a special line for each of my applications,
but it works (as long as you have killall or sth. equivalent that returns
if processes have been killed). Actually I don't use it in menus but
in FvwmButtons. So I can pop FvwmCommand, netscape or a console window
up and down with a single button.

Bye

Dominik
-- 
Dominik Vogt, Hewlett-Packard GmbH, Dept. BVS
Herrenberger Str.130, 71034 Boeblingen, Germany
phone: 07031/14-4596, fax: 07031/14-3883, [email-masked]
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
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: Tim Phipps <[email-masked]>
Date: Mon, 07 Dec 1998 15:30:53 +0000

>    Commands containing spaces must be quoted.

Are you sure you want this? What would happen with

Toggle "Exec oclock" "Exec xclock"
Toggle "Exec xterm" "Exec rxvt"
Toggle "Exec oclock" "Exec xclock"

What I mean is: do you want Toggle to look at its arguments and compare them with the
previous ones or do you just want to execute Toggle and have one of two predefined
commands happen?  If the latter then try:

DestroyFunc Toggle1
AddToFunc Toggle1 "I" DestroyFunc Toggle
+ "I" AddToFunc Toggle "I" command1
+ "I" AddToFunc Toggle "I" Toggle2
DestroyFunc Toggle2
AddToFunc Toggle2 "I" DestroyFunc Toggle
+ "I" AddToFunc Toggle "I" command2
+ "I" AddToFunc Toggle "I" Toggle1
Toggle

Cheers,
Tim.

---

From: Tim Phipps <[email-masked]>
Date: Mon, 07 Dec 1998 15:38:01 +0000

>   AddToMenu Modules "FvwmPager" Exec "killall FvwmPager || FvwmCommand FvwmPager"

If this is all you need you can use the presence of the window rather than try to add
state to fvwm.

AddToFunc TogglePager "I" Next [FvwmPager] KillModule FvwmPager
+ "I" None [FvwmPager] FvwmPager

you might need CirculateHit/CirculateHitIcon in the Next [] if you have
CirculateSkip/CirculateSkipIcon  set for FvwmPager.

Cheers,
Tim.

---

From: Tim Phipps <[email-masked]>
Date: Mon, 07 Dec 1998 15:44:12 +0000

> + "I" AddToFunc Toggle "I" Toggle1

Try Toggle1 on the last line to kick start (Toggle doesn't exist yet)

---

From: Dominik Vogt <[email-masked]>
Date: Mon, 7 Dec 1998 16:51:51 +0100

> + "I" None [FvwmPager] FvwmPager

You're right, that's much easier. In fact I'm an expert in shell
programming (zsh really helps :) ) and most of the time I try
to express everything as shell commands (and I don't like
reading lengthy manpages ;-) ).

Bye

Dominik