give arguments to an fvwm function through a bash script


The subject sounds crappy but let’s see.

In a bash script I want to give some arguments to a fvwm function.

So there is in the bash script:

FvwmCommand MyFvwmFunction 1_argument 2_argument

Then in my config I have:

[code]DestroyFunc MyFvwmFunction
AddToFunc MyFvwmFunction

  • I SetEnv arg_1 $0
  • I SetEnv arg_2 $1

And normally if all worked fine, I should get in a terminal the value of arg_1 and arg_2 by typing “echo arg_1” but niet nada nothing!!

If someone as and idea about this, you’ll be be welcome!

Best regards, Brice

[color=red]Edited by theBlackDragon:
–> Moved from Basic questions[/color]

Are you trying to call an fvwm function from within a bash script that is being called from fvwm?

If you PipeRead your script into fvwm, you can have it echo a SetEnv, and that will set the variable in the scope of the fvwm config.

You can also echo whatever function name and pass it variables that are set by the config or in your script, and they will be resolvable to fvwm.

If you are trying to set a variable in fvwm, and call a script, the script will inherit that variable in the environment.

Sorry if I missed what you are attempting, your sample code is too generic and my simple mind is unable to figure out exactly what you are trying to do.

Oh, I see, your bash script is invoking FvwmCommand to call the function. So in fvwm-land, the variables arg_1 and arg_2 should now be set to 1_argument and 2_argument. Then you are launching a term and expecting to be able to echo them. That does work, assuming you typed echo $arg_1 in your term… Try running FvwmCommand in your term outside of the script and seeing if it gives you an error message of some sort. I’ve never been able to run FvwmCommand to do stuff, so I invoke all my scripts by doing a PipeRead from a function.


I solved this matter. I will soon post the purpose of this script (a mail popup applet).

So wait a bit for that!



the answer is here:


I saw you got rid of the SetEnv in your function, I suspect the reason why it didn’t work is the same as the one here:

EDIT: typo