Does it really matter if I place “Test” command before or after “+ I” “*FvwmPager:…”?
For example what is better?
DestroyFunc enter_handler
AddToFunc enter_handler
Test (EnvMatch HOSTNAME cygwin) + I autohide Launcher 250 2500 S
Test (EnvMatch HOSTNAME linux) + I autohide Launcher 250 500 S
This is bad because now you rely on the ordering of “AddToFunc” here being the last one before your Test conditions are run. This is very easily broken if you shift your config around. Also, note that without putting those Test lines in a function, you’re always going to evaluate them if your config is re-read by FVWM – which may well result in duplicte entries in “enter_handler” or some other function.
This one is better, because it always evaluates in the function context of “enter_handler”, without relying on the side-effects with your first example.
I am assuming that you’re setting HOSTNAME in FVWM’s environment as well then? SInce it’s not exported in the environment FVWM usually runs in.
Thank you for quick answer.
Yeah, first I had a problem with debugging what is wrong under linux, since under cygwin $HOSTNAME env. var. is exported by default, then I realized that in linux I have to export it adding a line in .bashrc.
What about the following 2 pieces of code. Here imho I have no choice where to put ‘Test’ commands other than in the begineeng.
[code]DestroyMenu FvwmRootMenu
AddToMenu FvwmRootMenu “Root Menu [Alt-F5]” Title
That is fine, because when FVWM reads its config file, it does so on a single pass through, so the above will interpolate once, without relying on anything before it.
That’s a completely different question to your first one, above. But you do need this one anyway if you want to selectively load modules based on host in this way.