Subject: FVWM: One key - two altering functions ... one key

From: Thomas Glanzmann <[email-masked]>
Date: Sun, 5 Jan 2003 23:31:33 +0100

Hi out there,
want to set a (un)mute button on my keyboard to do the following:

When I press mute the first time the command aumix -v m should be executed, when
I press it the first time aumix -v 100 should be executed. So what can I do?

I tried the following, which does not work.

Key     SunAudioMute        A A SunAudioMute

DestroyFunc SunAudioMute
AddToFunc SunAudioMute
        + I Exec aumix -v m
        + I DestroyFunc SunAudioMute
        + I AddToFunc SunAudioMute
        + I + I Exec aumix -v 100
        + I + I DestroyFunc SunAudioMute
        + I + I AddToFunc SunAudioMute
        + I + I Exec aumix -v m

Please reply also by email because I am not on the list.

Greetings,
	Thomas
--
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: Dan Espen <[email-masked]>
Date: Sun, 05 Jan 2003 18:32:22 -0500

> Please reply also by email because I am not on the list.

Destroying a function while still in the function is not allowed.
Here's one way to do it using piperead and setenv:

Key SunAudioMute A A Piperead 'if [ "$$mute" == "mute" ] ; then \
  printf "setenv mute no"; aumix -v 100; \
  else printf "setenv mute mute"; aumix -v m; fi'

-- 
Dan Espen                           E-mail: [email-masked]