start xterm on a specific desk with xterm -xrm "*Desk: $d"

Hi, I would like to start xterms on specific desktops using something like

xterm -xrm “*Desk: $d”

this works, however it also changes the current desktop to the desktop where the xterm is being started.
How can I start the xterm on a desk without changing the current desktop?

thank you,

One way to achieve this is give the xterm you are starting a different class and use the SkipMapping style

You will need this style line

Style XTerm-NoMap SkipMapping

then you will start the xterm with the additional -class option

# xterm -class "XTerm-NoMap" -xrm "*Desk: $d"

Thank you Jaimos, that looks like a fine solution.

So is the “*Desk” resource being seen and interpreted by fvwm, or is that happening somewhere else?
If it’s in fvwm, can you point me to where that code is?

Is setting the “*Desk” resource equivalent to hacking the xterm source to allow setting the _NET_WM_DESKTOP property?

Is there any downside to setting SkipMapping as a global default? I can’t imagine I ever want my current desk warped because a window decides to pop up on another desk.

thank you

Search the man page for the Styles: StartsOnDesk and StartsOnPage

These are the styles that are used to map a window to a given Desk/Page. FVWM honors the hint that is being set and this mentioned in the man page, including what the numbers mean in terms of FVWMs Desks and Pages layout.

Hmm is it fvwm/placement.c function __place_handle_x_resources where it’s handling the “*Desk” resource?
So really it’s parsing the program’s command line, not the actual resources?
Does the program actually have to support -xrm, or can it merely ignore it?
Gotta run now, will have to look into this more later…

It appears to me that it is reading the xrdb resource database and not the command line. All that command is doing is making a setting is adding a resource screen to the database.

I doubt it is reading the command line. But via Styles you can use StartsOnPage to configure what page applications start on and you don’t have to configure it via the resource.

Hmm I’m pretty sure it is in fact parsing the application’s argument list, looking for -xrm options and treating those as resource settings. This appears to be why even though xemacs supports -xrm, it does not work to set the desk via ‘-xrm “*Desk: $d”’, because xemacs is not setting the WM_COMMAND property like xterm does (as can be seen via ‘xprop’ utility).

Specifically the code in __place_handle_x_resources does the following:

  • XGetCommand() to get the application’s command line argument list from the WM_COMMAND property
  • MergeXResources() is adding the default X resources
  • MergeCmdLineResources() is parsing the application’s command line argument list and populating resources based on table
  • GetResourceString() is searching those resources, but importantly this relies on the application providing it’s command line arguments via the WM_COMMAND property and then re-parsing its command line for -xrm arguments.

But via Styles you can use StartsOnPage to configure what page applications start on and you don’t have to configure
it via the resource.

sure that would work if I wanted all my xterms in a single desktop, but that doesn’t make any sense. what I ultimately want to do is automatically re-populate all the xterms and emacsen I was running in approx 10 desktops prior to having to reboot when I start fvwm.

anyway I have the info I need now, thank you very much for pointing me to the right docs!