How to maximize the inital window on startup, but no others.

I want to have certain programs start maximized. I was referred to this post:

http://fvwmforums.org/wiki/CookBook/InitialMapCommand/

This does make the inital window maximized, and also every other window associated with that class. How can I just make the windows on inital startup maximized?

It doesn’t appear that I can use ‘InitialMapCommand’ in the ‘StartFunction’.

Maybe I have to write a script that is run once ‘StartFunction’ has completed?

You have to be able to identify the window you want with a unique name/class/resource. Some programs have an option to set a class, such as -class, that you can use for that. I would look to see if you can configure the window you want to maximize in such a way you can distinguish it so you can use a style for it.

The other option is to write a launcher script, that runs the program, then uses the Wait command, and then maximizes the window that was just launched. I’m unsure on the details, but this should be possible to write something that works.

For the Seamonkey web browser, there is no way to set a special name or class for the window. And having the download window, or random popup windows loading maximized is irritating as hell.

Should I ask this in a different forum? I feel this is the way I’m needing to go.

So the browser windows always have class of Seamonkey, but yet the resource or name of the windows still varies. For example, since the main browser window has resource of Navigator, you might try…

Style Seamonkey InitialMapCommand ThisWindow (Navigator) Maximize

Similarly, you might maximize or modify other windows with specific resource or name using something like…

[code]Style Seamonkey InitialMapCommand SeamonkeyFunc

DestroyFunc SeamonkeyFunc
AddToFunc SeamonkeyFunc

  • I ThisWindow (Navigator) Maximize
  • I ThisWindow (Preferences) Maximize
  • I ThisWindow (Data) WindowStyle Title[/code]

Ty for your help. This solution does work, but it still makes all other ‘Navigator’ windows to open maximized, and I’m only looking for the first instance.

I needed to create an InitFunction to load all my programs, and step through them one by one:

[code]DestroyFunc InitFunction
AddToFunc InitFunction

  • I GotoDesk 0 0
  • I Exec exec seamonkey
  • I Wait Seamonkey
  • I All (Seamonkey) Maximize
    [/code]

This will maximize the first instance of Seamonkey and no others. Thanks to your reply, it helped me solve the problem.

Actually, you don’t.

Style whatever InitialMapCommand "None (whatever) Maximize"

You never want to use InitFunction either, see: fvwmforums.org/wiki/Tips/FvwmStartup/

– Thomas Adam

I now see what you’re saying, as I forgot it was preceeded by the InitalMap keyword.

I was thinking about this, and I understand that I can run a test for Init during the startup function. But I have several steps involved in my InitFunction, and for every step I would need to Test (Init) before doing what it needs to do. Seems I would be adding an extra step to every step I take, and after several lines of code, I can see this adding up.

Also, I was reading the ArchWiki and it says:

The bolded word, “Recommended” is actually a hyperlink that links to http://www.fvwmforums.org/phpBB3/viewtopic.php?f=40&t=1505. Reading this, I found:

But it doesn’t say I can’t. If I knew why using Test (Init) is better than using an InitFunction, I might feel better about using it. I’m not complaining or trying to start something, I just don’t get it.

You can make a bowl of cereal by getting a bowl, getting the milk, getting the cereal, getting a spoon. Or you can test if you have a bowl, then get the bowl. Test if you have milk, then get the milk…

BTW, I appreciate your response.

It’s to do with function context, and execution. If you mix/match Test (Init) with InitiFunction , FVWM won’t internally aggregate those in order – there is a greater chance you won’t get the results you expect. This was largely why StartFunction and Test learned these things, and hence why you should use StartFunction.

HTH.

– Thomas

I see what you’re saying. So the problem only lies in using both methods at the same time. FTR, As soon as I create an InitFunction, there is no need to keep anything in the StartupFunction with Test (Init).