X resources for java apps from command line

Is it possible to give command line arguments to a java application such that all the UIs from that JVM show up in a specific desktop?

Similar to following commsnd line:
xterm -xrm “*Desk:1”

No, since Java applications don’t respond to the X Resource Database. You’ll have to use the application’s class name and set style lines for it, as in:

Style some_name StartOnDesk 1, SkipMapping

– Thomas Adam

Thanks for the reply.

Giving a style in config file may not satisfy all our requirements. We will have multiple JVMs and multiple instances of same JVMs. we plan to have a desktop pool and cycle thru desktops. The dynamic behavior of allocating desktops to JVMs is difficult using config files.

Tough.

It really is that simple.

– Thomas Adam

I undertsand for different JVMs we can add to config file to provide the Style as you mentioned.

Style some_name StartOnDesk 1, SkipMapping

But, for the case of a JVM launched again and again requiring a different desktop, I am not clear how it can be done.

We are planning to have a fixed pool of desktops and depending on user actions we will need to recycle the desktops, such that we allocate a currently used desktop for some other need and move the remaining UIs in the current desktop to another desktop for future needs.

Can you elaborate on this in more detail?

It’s entirely doable via FvwmEvent, but I’d need a lot more information.

Note that this would be a lot easier if java applications allowed you to set X resource hints via the command-line, since you could then use the special case of: ‘fvwmstyle’ as an option…

– Thomas Adam

BBBB

So these are so named? If so, you’d only need assign style lines for them, as in:

Style app1 StartsOnDesk 1
Style app2 StartsOnDesk 2
Style app3 StartsOnDesk 3

If not, and you know you’re starting up a finite set of applications and you don’t care which one of them starts on a specific desk you could do something like this:

DestroyFunc StartFunction
AddToFunc   StartFunction
+ I Test (Init) Exec exec app1
+ I Wait app1
+ I GotoDesk 0
+ I Test (Init) Exec exec app2
+ I Wait app2
+ I GotoDesk 1
....

The only caveat here is that FVWM could hang forever waiting for an application which doesn’t show up.

This will be tricky – there is no easy way of doing:

None( Desk $some_number) Next (Some_Application) MoveToDesk n

Although a patch for it would be trivial.

Doesn’t this invalidate your previous point somewhat?

Right – is this predetermined or not (see my commentary to your very first point in this reply.)

“Hides the UIs?” If you want to forget the specific window, see FvwmEvent and the DestroyStyle command.

Predetermined.

Yes – see the MoveTo{Page,Desk} commands. The best thing I would do is use window states and an internal SetEnv’d variable to track the previous and next “desktop pool” states. If you can fill in the blanks for me regarding the questions in this post, I’ll cobble something together for you.

It might depend on a slight patch to FVWM – would this suit your development/deployment model? (And given that this is clearly proprietary from your end, what are the ramifications of your asking this in the first place?)

– Thomas Adam