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

From: Dan Espen <dane_at_mk.telcordia.com>
Date: Sun, 05 Jan 2003 18:32:22 -0500

Thomas Glanzmann <sithglan_at_stud.uni-erlangen.de> writes:
> 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, w
> hen
> 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.

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: dane_at_mk.telcordia.com
--
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 majordomo_at_fvwm.org.
To report problems, send mail to fvwm-owner_at_fvwm.org.
Received on Sun Jan 05 2003 - 17:34:58 GMT

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:37:54 BST