Setting LAYER from cli when invoking an xterm

I have an initial setup script when I start fvwm which invokes a lot of xterms across 10 desks, sizing them and adding titles where appropriate.

One desk is for compiling software on many machines, so there’s 16 xterms each with the title of the host.

e.g.:

# SPARC Sol 10 32bit build10s
xterm -title "SPARC Sol 10 32bit build10s" -xrm "*Desk:7" -sb -sl 5000 -ut -fg white -bg black -geom 150x17+${SCREEN0WIDTH}+248 -exec tcsh &
xterm -title "SPARC Sol 10 32bit build10s" -xrm "*Desk:7" -sb -sl 5000 -ut -fg white -bg black -geom 155x17+${SECONDWINSTART}+248 -exec tcsh &

# SPARC Sol 10 64bit build10s64
xterm -title "SPARC Sol 10 64bit build10s64" -xrm "*Desk:7" -sb -sl 5000 -ut -fg white -bg black -geom 150x17+${SCREEN0WIDTH}+504 -exec tcsh &
xterm -title "SPARC Sol 10 64bit build10s64" -xrm "*Desk:7" -sb -sl 5000 -ut -fg white -bg black -geom 155x17+${SECONDWINSTART}+504 -exec tcsh &

# SPARC Sol 11 64bit build11s64
xterm -title "SPARC Sol 11 64bit build11s64" -xrm "*Desk:7" -sb -sl 5000 -ut -fg white -bg black -geom 150x17+${SCREEN0WIDTH}+763 -exec tcsh &
xterm -title "SPARC Sol 11 64bit build11s64" -xrm "*Desk:7" -sb -sl 5000 -ut -fg white -bg black -geom 155x17+${SECONDWINSTART}+763 -exec tcsh &

What I want to do is automatically set the “LAYER +1” attribute on that xterm, so when I click to the compling desk, all the sticky windows I drag around when switching desks; they are backgrounded and all the compiling xterms are on top. I’ve mucked about with the -xrm option but can’t seem to nut out the right syntax to get the windows to layer + themselves, as well as also keeping the -xrm setting for the right desk etc. At the moment I have to manually LAYER +1 each of the xterms so they are raised up the stack and sit on top when I visit the desk.

Has someone else done this and can paste their cli?

ta++
Mark.

First you’ve to change the class of your compile xterms]

SPARC Sol 10 32bit build10s

xterm -class compile_xterm -title “SPARC Sol 10 32bit build10s” -xrm “*Desk:7” -sb -sl 5000 -ut -fg white -bg black -geom 150x17+${SCREEN0WIDTH}+248 -exec tcsh &
xterm -class compile_xterm -title “SPARC Sol 10 32bit build10s” -xrm “*Desk:7” -sb -sl 5000 -ut -fg white -bg black -geom 155x17+${SECONDWINSTART}+248 -exec tcsh &

SPARC Sol 10 64bit build10s64

xterm -class compile_xterm -title “SPARC Sol 10 64bit build10s64” -xrm “*Desk:7” -sb -sl 5000 -ut -fg white -bg black -geom 150x17+${SCREEN0WIDTH}+504 -exec tcsh &
xterm -class compile_xterm -title “SPARC Sol 10 64bit build10s64” -xrm “*Desk:7” -sb -sl 5000 -ut -fg white -bg black -geom 155x17+${SECONDWINSTART}+504 -exec tcsh &

SPARC Sol 11 64bit build11s64

xterm -class compile_xterm -title “SPARC Sol 11 64bit build11s64” -xrm “*Desk:7” -sb -sl 5000 -ut -fg white -bg black -geom 150x17+${SCREEN0WIDTH}+763 -exec tcsh &
xterm -class compile_xterm -title “SPARC Sol 11 64bit build11s64” -xrm “*Desk:7” -sb -sl 5000 -ut -fg white -bg black -geom 155x17+${SECONDWINSTART}+763 -exec tcsh &
[/code]
Now add the following to your .fvwm2rc]#-----------------------------------------------------------------------

Event Handler

#-----------------------------------------------------------------------
DestroyModuleConfig FvwmEventEnterDesk: *
*FvwmEventEnterDesk: new_desk FE-CompileXtermsUp

#-----------------------------------------------------------------------

Function raises all xterms with class ‘compile_xterm’ one layer up

if user switch to desk 7. On each other desk those xterms lower back

to their default layer

#-----------------------------------------------------------------------
DestroyFunc FE-CompileXtermsUp
AddToFunc FE-CompileXtermsUp

  • I SetEnv DESK $[desk.n]
  • I Test (EnvMatch DESK 7) All (compile_xterm, CurrentDesk) Raise
  • I TestRc (!Match) All (xterm_compile) Lower
  • I UnsetEnv DESK[/code]
    And this line to your StartFunction]
  • I Module FvwmEvent FvwmEventEnterDesk
    [/code]
    Unfortunately I’ve only pages but works there like a charm 8) (only exchanged $[desk.n] with $[page.nx] and new_desk with new_page - have a 1x4 pager).

Hope it works :slight_smile:

– Thomas –