I have a FvwmButtons bar on the top of my screen which I have swallowed all my windows into (icon manager/pager/xcb/cpu meter/clock/xterm buttons/etc) just like most other configurations for FVWM, but I had a problem with it getting covered up when a new window got launched so I needed a fix.
At first I found the EwmhBaseStruts option but quickly learned it would not work for version 2.4 of FVWM. Since I work for a large company and they don’t move to the latest version of FVWM very quickly I could not use the EwmhBaseStruts option. So I had to create a workaround; here is what I came up with for keeping windows from being placed on top of off of the button bar. This workaround allows me to keep the same Placement rules as before, because it only nudges the new windows that pop on top of the button bar off of it.
[code]DestroyFunc InitFunction
AddToFunc InitFunction
- I Module FvwmEvent
- …
DestroyModuleConfig FvwmEvent: *
*FvwmEvent: add_window NewWindowFunc
DestroyFunc NewWindowFunc
AddToFunc NewWindowFunc
- I ThisWindow (FvwmButtons) SetEnv b_width $[w.width]
- I ThisWindow (FvwmButtons) SetEnv b_height $[w.height]
- I ThisWindow (!Fvwm*) PipeRead ‘if [ $[b_width] -gt $[w.x] ] && [ $[b_height] -gt $[w.y] ] ; then echo Move $[w.x]p $[b_height]p ; fi’
[/code]
Here is some of my notes on figuring this workaround out. PipeRead is a cantankerous little thing! It is odd to work with because you’re “echo Echoing” things back to FVWM from the shell. It uses the “sh” Bourne shell which is frankly a strange little shell script language. White space, brackets, and semicolons are required in the Bourne shell. For my system the “test” shell command would only return an empty string so I had to use the “if” shell command instead. I had to build the statement bit-by-bit in a separate shell xterm, practice echoing it from the FVWM function, and then finally change it over to executing code. I excluded FVWM windows from this nudge because most of them I don’t want moved anyways.
Over all this little bit of code works great for my issue. I only see the window get nudged occasionally when the system has a big load on it so there is not a big visual issue with this workaround. I welcome any ideas and feedback, because you never know what one might have overlooked.
Thanks, Mark